--To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/28DyvI5tDw8J.
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
<head><title> Change WorkType </title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.ReloadTranscriptEditor(); else if (window.opener) window.opener.ReloadTranscriptEditor(); self.close(); } </script>
Looks like you have dealt with the "alert(msg);" popup.
You could be gettign eother of these two windows/dialogs appearing:parent.dialogArguments.ReloadTranscriptEditor();
window.opener.ReloadTranscriptEditor();
But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/jVCxJ7aKwKgJ.
1.
String winHandleBefore = driver.getWindowHandle();
driver.findElement(By.id("btnChangeWorkType")).click();
Thread.sleep(1000);
for(String winHandle : driver.getWindowHandles()){
driver.switchTo().window(winHandle);
}
System.out.println(driver.getTitle());
new Select(driver.findElement(By.id("ddlWorkType"))).selectByVisibleText("NOTE");
Exception: org.openqa.selenium.NoSuchElementException: Unable to find element by id using "ddlWorkType"
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.7.0_05'
Driver info: driver.version: ie
2. Set <String> handles =driver.getWindowHandles();
Iterator<String> it = handles.iterator();
//iterate through your windows
while (it.hasNext()){
String parent = it.next();
String newwin = it.next();
driver.switchTo().window(newwin);
driver.close();
}
This code is switching control to the main window.
Exception : java.util.NoSuchElementException
at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(Unknown Source)
at java.util.LinkedHashMap$KeyIterator.next(Unknown Source)
3. Set<String> beforePopUp = driver.getWindowHandles();
driver.findElement(By.id("btnChangeWorkType")).click();
Thread.sleep(1000);
//Get all the window handles in a set
//get window handles after the click
Set<String> afterPopup = driver.getWindowHandles();
//remove all window handles before the popup
afterPopup.removeAll(beforePopUp);
if(afterPopup.size() == 1) {
popUp = (String) afterPopup.toArray()[0];
} else {
}
//switch to popUp
driver.switchTo().window(popUp);
Exception : java.lang.NullPointerException: String initializer must be non-null
at com.sun.jna.WString.<init>(WString.java:23)
Have you tried getWindowHandles()?
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J.
parent.dialogArguments.ReloadTranscriptEditor();
window.opener.ReloadTranscriptEditor();
create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.
Nothing in your attachment tells us that that I can see.
Peter
Note:- Change of Work Type will Reload the Editor Window. | ||
Work Type: | ||
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/rBsgqaB9mEQJ.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/Zgg6-iDdC_IJ.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/MujKF9ba7UgJ.
2. Set <String> handles =driver.getWindowHandles();
Iterator<String> it = handles.iterator();
//iterate through your windows
while (it.hasNext()){
String newwin = it.next();
driver.switchTo().window(newwin);
driver.close();
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/QWZGpstPgRsJ.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/6uSlP0bLeXoJ.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/rvZsJ5z8vpsJ.
For more options, visit https://groups.google.com/groups/opt_out.
}
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/QWZGpstPgRsJ.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/6uSlP0bLeXoJ.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/rvZsJ5z8vpsJ.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/n9mUD1BmL9wJ.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/AWyDZj41YeoJ.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/stDgRfRzj78J.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/AmjhdoR12oQJ.
Hi,
I am using selenium webdriver to automate a web application.
In the application thee are some 'Modal pop up' windows and some are 'Ajax pop up' windows.I have tried with:driver.switchto().window() andAlert alert = driver.switchto().alert()But none of them are working.
Please suggest a solution for this.