Hi,
In my application "modal frame dialog window" opens after clicking on
radio button. I am using getWindowHandles() function but it doesn't
gives the dialog window handle. It only gives the handle of parent
window.
I am using code:-
String currentWindowHandle=objDriver.getWindowHandle();
objWebElement = objDriver.findElement(By.id(strTarget1));
objWebElement.click();
String htmlModalWindowHandle= null ;
Set<String> handles = objDriver.getWindowHandles();
for(String windowHandle:handles)
{
System.out.println(windowHandle);
if (!windowHandle.equals(currentWindowHandle)){
htmlModalWindowHandle=windowHandle;
System.out.println(htmlModalWindowHandle);
}
}
objDriver.switchTo().window(htmlModalWindowHandle);
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
It shows "java.lang.NullPointerException" error
As getWindowHandles() only give the handle of parent window not for
modal dialog.
Thanks
Mukesh
mraw...@gmail.com