Reputation: 140
I have a link that opens a modal dialog
How can Selenium 2 handle this.
Thanks
Aidan
Upvotes: 5
Views: 14082
Reputation: 21
This feature to handle modal dialog is not shipped yet into webdriver until the last release 2.0b3 (link).
Eagerly waiting for the next version to become public soon.(Test Environment: C#, Webdriver 2.0b3 and Nunit
).
Upvotes: 2
Reputation: 3134
With selenium 2 , I'm able to select elements in a jquery modal dialog using the normal "findElement" method.
e.g. the following code in c#
[Test]
public void DialogBox()
{
var driver = new FirefoxDriver();
driver.Manage().Timeouts().ImplicitlyWait(new TimeSpan(0, 0, 20));
driver.Navigate().GoToUrl("http://example.nemikor.com/basic-usage-of-the-jquery-ui-dialog/");
// open modal dialog
driver.FindElement(By.Id("opener")).Click();
// click a button on the modal dialog.
driver.FindElementByClassName("ui-icon ui-icon-closethick").Click();
}
Upvotes: 4
Reputation: 31371
I think there are some known issues on this http://code.google.com/p/selenium/issues/detail?id=284 but a possible solution given at this link
Upvotes: 1