-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample2_2.java
More file actions
29 lines (22 loc) · 789 Bytes
/
Example2_2.java
File metadata and controls
29 lines (22 loc) · 789 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
27
28
29
package com.SeleniumTestingSamples.Examples;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
//import org.openqa.selenium.firefox.FirefoxDriver;
//Firefox Browser
public class Example2_2 {
public static void main(String[] args) {
//WebDriver driver = new FirefoxDriver();
WebDriver driver = new ChromeDriver();
//Go to google home page
driver.get("https://www.facebook.com/");
String getTitle = driver.getTitle();
String expectedTitle = "Facebook – log in or sign up";
if(getTitle.equalsIgnoreCase(expectedTitle)) {
System.out.println("Verified!!");
System.out.println("Home page title is: "+getTitle);
}else {
System.out.println("Verification failed");
}
driver.close();
}
}