'How to take an alert string to check using Selenium in python

For negative testing I have to enter disabled text to test, but I cannot take the alert string which appears when the string is disabled. To test, I need to wait for an alert and take the text alert.

I used WebDriverWait(driver,10).until(EC.alert_is_present()), but it throws a TimeoutException.

Screenshot



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source