-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest.java
31 lines (20 loc) · 838 Bytes
/
Test.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
package selenium;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Test {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver","D:\\ChromeDriver\\chromedriver_win32\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
String baseUrl = "https://opensource-demo.orangehrmlive.com/";
driver.get(baseUrl);
driver.findElement(By.xpath("//*[@id=\"txtUsername\"]")).sendKeys("Admin");
System.out.println("Username Inserted");
//*[@id="txtPassword"]
driver.findElement(By.xpath("//*[@id=\"txtPassword\"]")).sendKeys("admin123 ");
System.out.println("Pasword Inserted");
driver.findElement(By.xpath("//*[@id=\"btnLogin\"]")).click();
System.out.println("Login Clicked");
// driver.quit();
}
}