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 Use following methods to switch to modelframe driver.switchTo().frame("ModelFrameTitle"); or driver.switchTo().activeElement() Hope this will work Amit Kapoor What you are using is not a model dialog, it is a separate window. Use this code: private static Object firstHandle; private static Object lastHandle; public static void switchToWindowsPopup() { Set<String> handles = DriverManager.getCurrent()