How to handle modal dialogs with selenium 2

I have a link that opens a modal dialog

How Selenium 2 will handle this.

thank

Aidan

+5
source share
3 answers

With selenium 2, I can select elements in a jquery modal dialog using the regular findElement method.

eg. 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();

    }
+4
source

This function for processing a modal dialog has not yet been sent to webdriver up to the latest version 2.0b3 ( link ). I look forward to when the next version will be public in the near future (test environment:) C#, Webdriver 2.0b3 and Nunit.

+2
source

I think there are some known issues on this http://code.google.com/p/selenium/issues/detail?id=284 , but this is a possible solution given here

+1
source

All Articles