forked from CourseRepository/SeleniumWebdriverWithJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestSelect.java
More file actions
58 lines (50 loc) · 1.68 KB
/
TestSelect.java
File metadata and controls
58 lines (50 loc) · 1.68 KB
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
53
54
55
56
57
58
package testcase;
import helper.ButtonHelper;
import helper.CheckBoxHelper;
import helper.ComboBoxHelper;
import helper.GenericHelper;
import helper.LinkHelper;
import helper.StartWebDriver;
import helper.TextBoxHelper;
import helper.WindowHelper;
import java.io.FileNotFoundException;
import org.testng.Assert;
import org.testng.annotations.Test;
/**
* @author - rahul.rathore
* @date - 16-Nov-2014
* @project - Webdriver
* @package - testcase
* @file name - TestSelect.java
*/
public class TestSelect extends StartWebDriver {
@Test
public void testDropDown() {
WindowHelper.navigateToPage(file.getUrl());
LinkHelper.clickLink("File a Bug");
TextBoxHelper.typeInTextBox("Bugzilla_login", file.getUsername());
TextBoxHelper.typeInTextBox("Bugzilla_password", file.getPassword());
CheckBoxHelper.clickCheckBox("Bugzilla_restrictlogin");
ButtonHelper.clickButton("log_in");
Assert.assertTrue(driver.getTitle().contains("Enter"));
//LinkHelper.clickLink("Administration");
//ButtonHelper.clickButton("div#header ul.links li:nth-of-type(9)>a");
LinkHelper.clickLink("Testng");
Assert.assertTrue(driver.getTitle().contains("Enter Bug"));
/*Select ser = new Select(driver.findElement(By.id("bug_severity")));
ser.selectByIndex(1);
ser.selectByValue("trivial");
ser.selectByVisibleText("normal");
*/
ComboBoxHelper.select("bug_severity", 1);
ComboBoxHelper.select("bug_severity", "trivial");
ComboBoxHelper.select("rep_platform", "Macintosh");
try {
throw new FileNotFoundException();
} catch (FileNotFoundException e) {
GenericHelper.takeScreenShot(this.getClass().getName()); //"TestSelect"
Assert.fail(e.toString());
}
ButtonHelper.clickLogout();
}
}