-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFirstScript.java
More file actions
29 lines (24 loc) · 805 Bytes
/
FirstScript.java
File metadata and controls
29 lines (24 loc) · 805 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 SeleniumScripts;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class FirstScript {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver","C:\\Users\\Hp\\OneDrive\\Desktop\\chromedriver\\chromedriver_win32\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.get("https://en.wikipedia.org/wiki/Main_Page");
driver.manage().window().maximize();
String title=driver.getTitle();
System.out.println(title);
if(title.contains("Wikipedia, the free encyclopedia"))
{
System.out.print("test case passed");
}
else {
System.out.println("test case failed");
}
String url=driver.getCurrentUrl();
System.out.println(url);
driver.close();
}
}