-
Notifications
You must be signed in to change notification settings - Fork 2
/
Examples.java
51 lines (43 loc) · 1.51 KB
/
Examples.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
package example;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import pojo.DesiredException;
import utility.*;
import utility.DriverSupport.*;
public class Examples {
WebDriver driver;
DriverSupport support;
DriverAction action;
CustomWait wait;
@Before
public void setUp() throws Exception {
String url = "https://www.seleniumeasy.com/test/input-form-demo.html";
driver = new GetDriver().chromeDriver(url);
support = new DriverSupport(driver);
wait = new CustomWait(driver);
action = new DriverAction(driver);
}
@After
public void tearDown() throws Exception {
driver.quit();
}
@Test
public void test_01() throws DesiredException {
action.setText(Locator.Name, "first_name", "Sourav");
action.setText(Locator.NameStartWith, "last_name", "Saha");
action.setText(Locator.NameEndWith, "email", "test.mail@gmail.com");
action.setText(Locator.NameContains, "phone", "9876543210");
action.setText(Locator.Name, "address", "Saha Maison");
action.setText(Locator.Name, "city", "Kolkata");
action.selectDropdownOption(Locator.Name, "state", "Texas");
action.setText(Locator.Name, "zip", "700093");
action.setText(Locator.Name, "website", "https://github.com/sahasourav123");
action.selectRadioOption(Locator.Name, "hosting", "No");
action.setText(Locator.Name, "comment", "Selenium Utilities");
support.takeScreenShot(ScreenShotType.FullPage);
support.jsClick(Locator.Xpath, "//button[@type='submit']");
wait.waitForPageLoad();
}
}