I added this code to my webpage:
<input id='argh' type='text' onfocus='this.value=7'>
If the browser window is not 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'
This succeeds just fine if the window is displayed during testing. In addition, if I activate the browser window after the aforementioned failure, #argh is focused and fills with a seven, I return to Selenium and re-run the line, this succeeds. (Perhaps obviously, but ...)
What am I doing wrong? How can I check things like the AJAX drop-down menu from Selenium without a browser?
My setup is Selenium IDE 1.0.2 on Firefox 3.5.3 on win32.