I\'ve recently run into a problem working with selenium where calling clear()
on a custom text box causes issues when entering text later in the test. The text
Here is what exactly clear()
will do. The function will clear textbox value and enable text box. Before entering text in text field we need to clear the text field and will enable it. If we do not use clear ()
, we can't enter any value in text field using selenium.
driver.find_element_by_xpath(xpath).clear()
driver.find_element_by_xpath(xpath).send_keys("data")