seleniummodal-dialogselenium-webdriver

How to deal with ModalDialog using selenium webdriver?


I am unable to switch to Modal Dialog of given example

http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/showModalDialog2.htm

I don't know how to get element on modal Dialog

enter image description here


Solution

  • Use

    following methods to switch to modelframe

    driver.switchTo().frame("ModelFrameTitle");
    

    or

    driver.switchTo().activeElement()
    

    Hope this will work