Reputation: 59
I have some code like this:
content.button(:id,/Submit/).click_no_wait
puts 2
autoit = WIN32OLE.new("AutoItX3.Control")
puts 3
autoit.WinWait "XXXX"
puts 4
autoit.ControlClick "","OK","Button1"
After click the Submit button,a alert box will pop out,and the code after will click OK of that.The function "click" will hang program there so I need to use "click_no_wait".
But as a result,I can get the puts of 3,and the submit button doesn`t been licked.
Why?And what is the best solution?
Upvotes: 0
Views: 386
Reputation: 1905
If the #click_no_wait
does not open the dialog, but regular #click
will, then it does not work for some reason. I have written a blog post about debugging #click_no_wait
problems at http://itreallymatters.net/post/1366392123/debugging-and-improving-watirs-click-no-wait-method#.UMCuJoOgnvA
In short, set $DEBUG
to true
before #click_no_wait
to get more troubleshooting information:
$DEBUG=true
content.button(:id,/Submit/).click_no_wait
$DEBUG=false
Upvotes: 0
Reputation: 57262
If you are dealing with javascript popups, see this page: http://watirwebdriver.com/javascript-dialogs/
Upvotes: 1