-
Notifications
You must be signed in to change notification settings - Fork 0
/
DemoQa.java
46 lines (39 loc) · 1.03 KB
/
DemoQa.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
package PageObjectModel;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.By;
public class DemoQa {
WebDriver driver;
By firstname = By.id("firstName");
By lastname = By.id("lastName");
By email = By.id("userEmail");
By gender = By.xpath("//*[@id=\"genterWrapper\"]/div[2]/div[1]/label");
By number = By.id("userNumber");
By subjects = By.xpath("//*[@id=\"subjectsContainer\"]/div/div[1]");
By hobbies = By.xpath("//*[@id=\"hobbiesWrapper\"]/div[2]/div[1]/label");
By address = By.id("currentAddress");
By submit = By.id("submit");
public DemoQa(WebDriver driver)
{
this.driver = driver;
}
public void nameA(String fname)
{
driver.findElement(firstname).sendKeys(fname);
}
public void nameB(String lname)
{
driver.findElement(lastname).sendKeys(lname);
}
public void Email(String mail)
{
driver.findElement(email).sendKeys(mail);
}
public void Gender()
{
driver.findElement(gender).click();
}
public void Mobile(String num)
{
driver.findElement(number).sendKeys(num);
}
}