browser.text_field(:id, "subscriber_id").wait_until_present(timeout = 100)before browser.text_field(:id, "subscriber_id").set("11111")
On Saturday, April 20, 2013 7:56:08 PM UTC+10, 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
browser.link(:text, "Manage Members").when_present.clickSecondly, your syntax for starting a browser is incorrect. It should be .new not .start.browser = Watir::Browser.new :chrome
browser = Watir::Browser.start "http://localhost:8080/admin/index.php/login"This is valid Watir code. Calling Watir::Browser.start with a URL as an argument is the same as:browser = Watir::Browser.newbrowser.goto "browser "http://localhost:8080/admin/index.php/login"You may need to dismiss the modal by clicking on whichever element dismisses the modal for the user. Without page HTML when the modal is visible and an indication of which line is giving the failure in your Watir code, it's difficult to provide any further guidance.
If you have HTML available, paste it in so we can further troubleshoot.
Andrew
browser = Watir::Browser.start url
is the same as
browser = Watir::Browser.newbrowser.goto url