There is a button on the site I am testing that sometimes triggers a
javascript pop-up, and sometimes it does not. If the pop up is
triggered, my code works as it should. It handles the pop up, and then
moves on to the next record in my loop. However, if there is NO pop
up, I need my script to just continue on as if the pop up handling
code was not even there. Currently, I get this:
c:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.2/lib/watir/waiter.rb:
59:in `wait_until': Timed out after 15.109 seconds.
(Watir::Exception::TimeOutException)
from c:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.2/lib/watir/
waiter.rb:80:in `wait_until'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/contrib/
enabled_popup.rb:10:in `enabled_popup'
Do you have any suggestions? This is driving me crazy! Here is a code
snippet. I need the code to continue with Step 6 if it does not see a
pop up. Thanks!
ie.button(:name, "SaveWorkflowChanges").click_no_wait
# javascript pop-up handler
hwnd = ie.enabled_popup(15)
if(hwnd)
popup = WinClicker.new
popup.makeWindowActive(hwnd) #Activate the window.
popup.clickWindowsButton_hwnd(hwnd,"OK") #Click the OK
button
smsg = _articleNumber.to_s + " " + "UNABLE TO PROCEED;
ACTIVE COTTAGE/VENDOR TASKS - ARTICLE SKIPPED"
log.info(smsg)
break _articleNumber
#ie.button(:name, "SaveWorkflowChanges").click()
# If there are no workflows currently mapped to the
journal...
if ie.p(:id,'savewarning').exists?
smsg = _articleNumber.to_s + " " + ie.p
(:id,'savewarning').text
log.info(smsg)
else
# Step 6
puts 'Step 6'
Watir::Waiter.wait_until{ie.select_list(:name,
'workflowStepId').exists? }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines:
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---