-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMercury.java
More file actions
26 lines (23 loc) · 803 Bytes
/
Copy pathMercury.java
File metadata and controls
26 lines (23 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package mercury;
import org.openqa.selenium.*;
import org.openqa.selenium.edge.*;
import java.util.Scanner;
public class Mercury {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.edge.driver","C:\\Users\\Abhishek\\Downloads\\edgedriver_win64\\msedgedriver.exe");
Scanner sc = new Scanner(System.in);
System.out.print("Enter Title: ");
String expected=sc.nextLine();//Welcome: Mercury Tours
String url = "https://demo.guru99.com/test/newtours/";
WebDriver driver=new EdgeDriver();
driver.get(url);
if(driver.getTitle().equals(expected)) {
System.out.println("Test Passed : Title Matched");
}
else
System.out.println("Test Failed : Title Mismatch");
driver.close();
sc.close();
}
}