-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTest4.java
More file actions
40 lines (31 loc) · 995 Bytes
/
Test4.java
File metadata and controls
40 lines (31 loc) · 995 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
30
31
32
33
34
35
36
37
38
39
40
package testng;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import io.github.bonigarcia.wdm.WebDriverManager;
public class Test4 {
@DataProvider
public Object demo() {
Object[][] obj=new Object[3][2];
obj[0][0]="admin";
obj[0][1]="manager";
obj[1][0]="1234434";
obj[1][1]="55655555";
obj[2][0]="6666&*&**fff";
obj[2][1]="ghgh5767#$%";
return obj;
}
@Test(dataProvider ="demo" )
public void tc1(String username ,String password) {
WebDriverManager.chromedriver().setup();
WebDriver driver=new ChromeDriver();
driver.manage().window().maximize();
driver.get("https://www.facebook.com/");
driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
driver.findElement(By.id("email")).sendKeys(username);
driver.findElement(By.id("pass")).sendKeys(password);
}
}