package TestPackage;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.RemoteWebDriver;
public class MyClass {
public static void main(String[] args) {
// declaration and instantiation of objects/variables
WebDriver driver ;
System.setProperty("webdriver.firefox.marionette","C:\\geckodriver-v0.16.1-win64\\geckodriver.exe");
driver = new FirefoxDriver();
String expectedTitle = "Welcome: Mercury Tours";
String actualTitle = "";
// launch Fire fox and direct it to the Base URL
driver.get(baseUrl);
// get the actual value of the title
actualTitle = driver.getTitle();
/*
* compare the actual title of the page with the expected one and print
* the result as "Passed" or "Failed"
*/
if (actualTitle.contentEquals(expectedTitle)){
System.out.println("Test Passed!");
} else {
System.out.println("Test Failed");
}
//close Fire fox
driver.close();
// exit the program explicitly
System.exit(0);
}
}
On Monday, 29 May 2017 15:12:30 UTC+5:30, Akshat Gupta wrote:
Code?