Sorry, the code:
require 'watir'
require 'watir/contrib/enabled_popup'
@ie = Watir::IE.new
@ie.goto("http://localhost:8080/FOO/")
@ie.frame("main") #stuff here to fill in Form #1
@ie.frame("main").button(:value, "Submit").click
@ie.back()
def startClicker( button , waitTime= 9, user_input=nil )
hwnd = @ie.enabled_popup(waitTime)
if (hwnd) # yes there is a popup
w = WinClicker.new
if ( user_input )
w.setTextValueForFileNameField( hwnd, "" )
end
w.clickWindowsButton_hwnd( hwnd, "OK" )
w=nil
end
end
if @ie.frame("main").contains_text("TITLE - FORM #2")
puts "Test passed. Page contains the text: TITLE - FORM #2."
else
puts "Test failed! Page didn't contain text: TITLE - FORM #2."
end
On Dec 3, 5:02 pm, Ruth <[EMAIL PROTECTED]> wrote:
> Hi, I'm pretty new to Watir. I'm currently revising (aka redo from
> start!) tests for an application. Basically the way it was originally
> was that there were two forms, once you got to form #2 the browser
> back button was disabled via JavaScript. If you hit back you stayed at
> form #2 rather than returning to form #1. That was trivial enough to
> test; you just asserted ie.contains_text(title of form #2)
>
> But now there's a helpful little popup saying 'The back button is
> disabled on this site!' I'm not sure if it's even possible to test for
> that? If you click it manually, then the test finishes and passes, but
> otherwise it hangs. I've had a look at the methods
> onhttp://wiki.seleniumhq.org/display/WTR/JavaScript+Pop+Ups, to see if I
> can get the Watir script to click 'ok' in the popup, but the key with
> JS popups seems to be using click_no_wait rather than just click, and
> you can't do that with ie.back()
>
> So is there any way around this at all? Ruby v 1.8.6, Watir v
> 1.5.4.1263
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---