Skip to content

Instantly share code, notes, and snippets.

@krmahadevan
Created July 12, 2011 08:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krmahadevan/1077645 to your computer and use it in GitHub Desktop.
Save krmahadevan/1077645 to your computer and use it in GitHub Desktop.
@Test
public void iamfiguringout(){
FirefoxDriver driver = new FirefoxDriver();
Selenium s = new WebDriverBackedSelenium(driver, "http://www.google.com");
Reporter.log("WDBS object created", true);
s.open("http://www.google.co.in/");
Reporter.log("URL opened", true);
String url = "window.open('intl/en/about.html','mywindow');";
s.openWindow("intl/en/about.html", "mywindow");
Reporter.log("new window opened", true);
printerValues("Window names", s.getAllWindowNames());
printerValues("Window IDs", s.getAllWindowIds());
printerValues("Window Titles",s.getAllWindowTitles());
s.close();
}
public void printerValues(String string, String[] array){
Reporter.log(string, true);
for (String value : array){
Reporter.log(value, true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment