-
Notifications
You must be signed in to change notification settings - Fork 0
/
Day5.java
41 lines (32 loc) · 1.04 KB
/
Day5.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
package Datadriven;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.By;
public class Day5 {
WebDriver driver;
@Test(dataProvider = "create")
public void test(String username, String Password) throws InterruptedException
{
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
driver.get("https://www.demo.guru99.com/V4/index.php");
Thread.sleep(3000);
driver.findElement(By.name("uid")).sendKeys("username");
driver.findElement(By.name("password")).sendKeys("Password");
driver.findElement(By.name("btnLogin")).click();
driver.switchTo().alert().accept();
driver.close();
}
@DataProvider(name="create")
public Object[][] dataSet()
{
return new Object [][]
{{"mngr56381","qYsajem"},
{"mngr563814","qYsaje"},
{"mngr56381","qYsaje"},
{"mngr563814","qYsajem"}};
}
}