-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay3Testcase3.java
More file actions
28 lines (22 loc) · 861 Bytes
/
Copy pathDay3Testcase3.java
File metadata and controls
28 lines (22 loc) · 861 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
package Guru99;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import io.github.bonigarcia.wdm.WebDriverManager;
public class Day3Testcase3 {
public static void main(String[] args) throws InterruptedException {
WebDriverManager.chromedriver().setup();
WebDriver driver = new ChromeDriver();
driver.get("https://www.demo.guru99.com/V4/index.php");
driver.manage().window().maximize();
//TestCase3 invalid userid invalid password
driver.findElement(By.name("uid")).sendKeys("mngr56381");
driver.findElement(By.name("password")).sendKeys("qYsaje");
driver.findElement(By.name("btnLogin")).click();
Thread.sleep(5000);
driver.switchTo().alert().accept();
Thread.sleep(5000);
driver.quit();
System.out.println("Login failed");
}
}