I added this code to my web page:
<input id='argh' type='text' onfocus='this.value=7'>
Unless the browser window is active, the focus event does not seem to fire (using the 'focus' command) from Selenium:
# [info] Executing: |waitForElementPresent | argh | |
# [info] Executing: |focus | argh | |
# [info] Executing: |verifyValue | argh | 7 |
# [error] Actual value '' did not match '7'
It succeeds just fine if the window is showing during testing. Furthermore, if I activate the browser window after the above failure, #argh is focused and fills with a seven, then I go back to Selenium and rerun the line, it succeeds. (Probably obvious, but...)
What am I doing wrong? How will I be able to test things like AJAX dropdown menus from Selenium without the browser showing?
My setup is Selenium IDE 1.0.2 on Firefox 3.5.3 on win32.
Does it make any difference if you use the fireEvent command?
fireEvent | argh | focus
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With