-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment188_05TC.java
More file actions
37 lines (27 loc) · 884 Bytes
/
Assignment188_05TC.java
File metadata and controls
37 lines (27 loc) · 884 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
package TestNGCLAssignments;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
public class Assignment188_05TC {
WebDriver driver;
@Test
@Parameters("browser")
public void myntra(String Browsername) {
if (Browsername.equals("chrome")) {
driver = new ChromeDriver();
driver.manage().window().maximize();
}
if (Browsername.equals("Firefox")) {
driver = new FirefoxDriver();
driver.manage().window().maximize();
}
driver.get("https://www.myntra.com/");
WebElement search = driver.findElement(By.className("desktop-searchBar"));
search.sendKeys("fossile watch" + Keys.ENTER);
}
}