jeudi 9 avril 2015

How to get the web page tittle from selenium webdriver?

Below is the code , used for getting the actual title form the Driver opened browser.



public class imsclass1 {

WebDriver driver;
String actualTitle;

@Test
public void test() {
driver.get("http://www.google.com");
actualTitle = driver.get actualTitle();
System.out.println("ActualTitle is +");
}
@BeforeClass
public void Beforeclass() {
driver = new FirefoxDriver();
}
@AfterClass
public void Afterclass() {
driver.quit();
}
}


Output gets displayed as Actual Title is


What i Want is "Web page title" displayed in the browser. needs to be get printed in my console





Aucun commentaire:

Enregistrer un commentaire