|
|
|
[
Permlink
| « Hide
]
sCrIpT mUnKeE - 29/Jan/08 12:59 PM
Please move this bug to the proper component section.
I performed the same test using watir 1.4.1 on my windows xp system running ruby 1.8.5-24. The test passed as expected. Then I upgraded back to 1.5.3, registered the AutoIt3x and ran the tests. The tests fail as documented above.
I've updated the summary and am adding the following notes from
In IE7, certain methods, e.g. text_field.set() send focus to IE7. This is compounded because .focus doesn't work when focus is in the address bar. For example: #Try to search by typing a string & hitting ENTER. (Fails) $browser.goto("http://www.google.com") $browser.text_field(:name, 'q').set("ruby") $browser.send_keys("{ENTER}") #Expected - ENTER goes to text field (and so submits form). #Actual - After the set, focus seems to go to the address bar, and so the ENTER is sent there. #Variation 1: Try to shift focus back after the set. (Fails) $browser.goto("http://www.google.com") $browser.text_field(:name, 'q').set("ruby") #At this point, focus mysteriously moves to the address bar $browser.text_field(:name, 'q').focus #No effect since focus is in address bar $browser.send_keys("{ENTER}") #Actual - Same as above - ENTER goes to address bar Here is a workaround that does succeed: #Variation 2: Tab to get out of address bar, then shift focus back after set. (Succeeds) $browser.goto("http://www.google.com") $browser.text_field(:name, 'q').set("ruby") #At this point, focus mysteriously moves to the address bar $browser.send_keys("{TAB}") #This takes focus away from address bar... $browser.text_field(:name, 'q').focus #...only after which will focus work $browser.send_keys("{ENTER}") #Success! Enter is sent to the text field, triggering a search. Ideally, we should figure out why focus is jumping in IE7, and stop it from doing so. If we can do that, being able to set .focus from the address bar becomes less important. |
|||||||||||||||||||||||||||||||||||||||||||||||||||