-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDatadriven2.java
33 lines (29 loc) · 947 Bytes
/
Datadriven2.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
package DataDrivenFrameWork;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.By;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import io.github.bonigarcia.wdm.WebDriverManager;
public class Datadriven2 {
WebDriver driver;
@Test(dataProvider = "create")
public void test(String Username, String Password)
{
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
driver.get("https://www.facebook.com/login/");
driver.findElement(By.id("email")).sendKeys("Username");
driver.findElement(By.id("pass")).sendKeys("Password");
driver.findElement(By.id("loginbutton")).click();
driver.close();
}
@DataProvider(name="create")
public Object[][] datset()
{
return new Object [][]
{{"[email protected]","9986078150"},
{"[email protected]","8105813019"},
{"[email protected]","7406612475"}};
}
}