There's a few funny things about your script.  You really only need to 
require watir or watir-webdriver.  If you're using the watir gem it'll 
either load the watir-classic gem, if you ask it for ie, or watir-webdriver 
gem if you ask it for chrome or firefox.

Secondly, your syntax for starting a browser is incorrect.  It should be 
.new not .start.
browser = Watir::Browser.new :chrome

As far as handling the alert, you can do something like this after you 
click on whatever element that causes the spinner to popup.  This below 
will just wait until the dialog goes away.

browser.alert.wait_while_present

It's nice to see that you're using the wait methods.  It seems lots of 
people who are just starting out end up using sleeps which is bad practice. 
 You can actually collapse two lines into one like below as well.


browser.link(:text, "Manage Members").when_present.click


On Saturday, April 20, 2013 5:56:08 AM UTC-4, Christian Scheid wrote:
>
> Hi,
>
> I'm just starting to use Waitir and have the following issue: The Waitir 
> script is supposed to execute a search on a KendoUI Grid element which in 
> turn displays a modal spinner when performing an ajax call to retrieve the 
> search results. (script below). Waitir throws an UnhandledAlertError 
> because a modal dialog is present (below). I've seen Waitir code to handle 
> javascript pop ups but I haven't found a solution how to handle a modal 
> pop-up without any buttons like a spinner.
>
> Any ideas?
>
> Thanks!
>
> *Error*: nsCommandProcessor.prototype.execute': Modal dialog present 
> (Selenium::WebDriver::Error::UnhandledAlertError)
>
> *Script:*
>
> require 'watir'
> require 'watir-webdriver'
>
> browser = Watir::Browser.start "http://localhost:8080/admin/index.php/login";
> browser.link(:text, "Manage Members").wait_until_present
> browser.link(:text, "Manage Members").click
> browser.text_field(:id, "subscriber_id").set("11111")
> browser.button(:value,"Search").click
>
>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to