-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAssignment188_01TC.java
52 lines (34 loc) · 1.19 KB
/
Assignment188_01TC.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
42
43
44
45
46
47
48
49
50
51
52
package TestNGCLAssignments;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
//Do Cross-Browser Testing with 5 TestCases?
public class Assignment188_01TC {
WebDriver driver;
@Test
@Parameters("browser")
public void crossbrowsing(String Browsername) {
if (Browsername.equals("chrome")) {
driver = new ChromeDriver();
}
if (Browsername.equals("firefox")) {
driver = new FirefoxDriver();
}
if (Browsername.equals("edge")) {
driver = new EdgeDriver();
}
driver.get("https://www.facebook.com/");
driver.manage().window().maximize();
WebElement email = driver.findElement(By.xpath("//input[@ id = 'email']"));
email.sendKeys("[email protected]");
WebElement password = driver.findElement(By.xpath("//input[@ id = 'pass']"));
password.sendKeys("[email protected]");
WebElement Login = driver.findElement(By.xpath("//button[@ name='login']"));
Login.click();
}
}