WebDriver f=new FirefoxDriver();
f.manage().window().maximize();
f.get("http://newtours.demoaut.com/");
String at=f.getTitle(); //using the gettitle method get the title from the page and store in string variable
System.out.println(at);
String et=”Welcome: Mercury Tours”;
if(at.contentequals(et)) //using if condition and check the expected and actual title
{
System.out.println(“pass”);
}
else
System.out.println(“false”);
}
No comments:
Post a Comment