-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDropDown.js
40 lines (29 loc) · 1.04 KB
/
DropDown.js
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
describe('Protractor DropDown Demo', function () {
function Calc(a, b, c) {
element(by.model("first")).sendKeys(a);
element(by.model("second")).sendKeys(b);
//
element.all(by.tagName("option")).each(function (item) {
item.getAttribute("value").then(function (values) {
if (values == c) {
item.click();
}
})
})
element(by.id("gobutton")).click();
}
it('Locators', function () {
/*browser.waitForAngularEnabled(false);
browser.get("http://google.com");//non angular apps*/
browser.get('http://juliemr.github.io/protractor-demo/');
Calc(3, 5, "MULTIPLICATION");
Calc(3, 5, "DIVISION");
Calc(3, 5, "DIVISION");
Calc(10, 6, "ADDITION");
element.all(by.repeater("result in memory")).each(function (item) {
item.element(by.css("td:nth-child(3)")).getText().then(function (text) {
console.log(text);
})
})
})
})