Yes I am coming to main window after fill the data from the main window as I already explained Above..
if you did not understand my code please tell me the code how to execute code after fill the data ..from pop up window and back to main window and resume working on main window.
I think it is more easy to you and me also
having said that as code regarding --POP up provided by you for action on Pop Up is not working here. this is only for closing the pop up only
so give me the code which you think should used
Reply ASAP
[code:1p1fkckf]driver.get("your website");
// Store parent window name
String parent_window = driver.getWindowHandle();
// print parent window ID
System.out.println(parent_window);
// Get list & Size of all open windows
List<String> windows = new ArrayList<String>(driver.getWindowHandles());
System.out.println(windows.size());
System.out.println(windows);
System.out.println(driver.getTitle());
for (String child_window : windows) {
if (!parent_window.equals(child_window)) {
//switching to pop up
driver.switchTo().window(child_window);
System.out.println(driver.getTitle());
} else {
System.out.println(driver.getTitle());
}
}
System.out.println(driver.getTitle());
driver.close(); // closing the pop up. deepak you don't need to do this
driver.switchTo().window(parent_window); //returning to main window.
System.out.println(driver.getTitle());
[/code:1p1fkckf]
Hi When I am using ur code focus is going to move from pop up to main window whithout fill the data of the Pop Window
and this pop remain open in the back of the Main window
OutPut is fail with the below message
{a3763f14-b974-49ab-96a2-4e4dbbdce40e}
2
[{a3763f14-b974-49ab-96a2-4e4dbbdce40e}, {56bf93e4-a0c1-4289-a188-bc133aa78e9a}]
iLien
iLien
iLien Online - Folder Name Lookup
iLien Online - Folder Name Lookup
iLien
FAILED: CompleteUccForm
org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"xpath","selector":"//*[@id='txtNameLookup']"}
Command duration or timeout: 50.11 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Method -2
when I am commenting
//driver.switchTo().window(parent_window); //returning to main window.
able to fill the data of the POP up also getting error --
org.openqa.selenium.NoSuchWindowException: Window not found. The browser window may have been closed.
Command duration or timeout: 16 milliseconds
Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:55:52'
System info: host: 'DS-E0699598D816', ip: '10.97.222.20', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_66'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=37.0.2, platform=WINDOWS, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: a9dd2842-6c12-4ef7-914c-b49737e18cdd
*** Element info: {Using=xpath, value=//*[contains(@name,'btnSelect')]}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
still same issue ..unable to proceed with main window and test case getting failed