I'm writing tests using selenium. In those tests I need to enter a number into a field in a form.
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!
BTW, if I change the type of the field to "text" for example there is no problem at all. In addition, field.send_keys(Keys.UP) work great (but doesn't work when I'm using bootstrap) and field.clear() work all the time, as well as field.click().
Selenium version: 2.41.0 Firefox version: 29.0
send_keysin a loop:for x in '12': field.send_keys(x)? - alecxefield.click()does focus on the input field.field.send_keysalso focus on the field but nothing more. - Nagasaki45