I am writing tests using selenium. In these tests, I need to enter a number in the form field.
Here is the html:
<!DOCTYPE html> <html> <head> </head> <body> <form> <input type="number" id="field_id"> </form> </body> </html>
And the code:
browser = webdriver.Firefox() browser.get('file:///home/my_username/test.html') field = browser.find_element_by_id('field_id') field.send_keys('12') # NOTHING HAPPEN!
By the way, if I change the type of the field to "text", for example, there is no problem at all. Also, field.send_keys(Keys.UP) works fine (but doesn't work when I use bootstrap) and field.clear() works all the time, as well as field.click() .
Selenium version: 2.41.0 Firefox version: 29.0
python firefox selenium selenium-webdriver
Nagasaki45
source share