Thursday, 16 February 2012

get The title of the current page using selenium webdriver


import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;


public class dadabhagwan_LearnSeleniumWithJasmine {

public static void main(String[] args) throws InterruptedException {

WebDriver dadabhagwan_driver1 = new  FirefoxDriver();

WebDriver dadabhagwan_driver2 = new  FirefoxDriver();

dadabhagwan_driver1.get("http://www.dadabhagwan.org/");
Thread.sleep(5000L);
System.out.println(dadabhagwan_driver1.getTitle());

dadabhagwan_driver2.get("http://kids.dadabhagwan.org/");
System.out.println(dadabhagwan_driver2.getTitle());



dadabhagwan_driver1.quit();
dadabhagwan_driver2.quit();

}

}