-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment192.java
More file actions
32 lines (20 loc) · 778 Bytes
/
Assignment192.java
File metadata and controls
32 lines (20 loc) · 778 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
package TestNGCLAssignments;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
//WAP to test the google search with 10 TestCases using DataProvider?
public class Assignment192 {
@DataProvider(name = "data1")
public Object[][] requireddata() {
return new Object[][] { { "facebook" }, { "instagram" }, { "flipkart" }, { "Amazon" }, { "Grotechminds" } };
}
@Test(dataProvider = "data1")
public void testcase01(String input) {
ChromeDriver driver = new ChromeDriver();
driver.get("https://google.com");
driver.findElement(By.name("q")).sendKeys(input);
driver.findElement(By.name("q")).sendKeys(Keys.ENTER);
}
}