import com.thoughtworks.selenium.DefaultSelenium;
public class GetData {
public static DefaultSelenium selenium=new DefaultSelenium("localhost",6666,"*iehta","http://");
public static String Bodytext()
{
selenium.start();
selenium.open("http://google.com");
selenium.windowMaximize();
selenium.type("q", "abc");
String str=selenium.getBodyText();
//String str=selenium.getHtmlSource();
String link[]=selenium.getAllWindowNames();
System.out.println("The links are"+link.length);
System.out.println("The links are"+link[0]);
selenium.captureScreenshot("D:\\Selenium\\page.jpg");
return "pass";
}
public static String Dynamic()
{
selenium.click("add1");
String windname[]=selenium.getAllWindowNames();
String windid[]=selenium.getAllWindowIds();
String windtitle[]=selenium.getAllWindowTitles();
selenium.getValue("");
System.out.println("The window names are"+windname.length);
selenium.selectWindow(windname[1]);
selenium.click("ok");
return "pass";
}
public static void main(String[] args) {
// TODO Auto-generated method stub
Bodytext();
}
}