-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.java
47 lines (27 loc) · 1.08 KB
/
demo.java
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package selenium;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class demo {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver","D:\\ChromeDriver\\chromedriver_win32\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
String baseUrl = "https://www.demoqa.com/";
String expectedTitle = "ToolsQA";
String actualTitle;
driver.get(baseUrl);
driver.findElement(By.id("firstName"));
System.out.println("Found Element");
driver.findElement(By.id("userEmail"));
System.out.println("Found Email Element");
driver.findElement(By.id("genterWrapper"));
System.out.println("Found Gender Element");
driver.findElement(By.id("subjects-label"));
System.out.println("Found Hobbie Element");
driver.findElement(By.id("userNumber"));
System.out.println("Found Mnumber Element");
driver.findElement(By.linkText("dynamicLink"));
System.out.println("Found Link Element");
driver.close();
}
}