-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFetchAllElement.js
36 lines (26 loc) · 1002 Bytes
/
FetchAllElement.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
describe('Fetch all elements Demo ', function () {
function add(a, b) {
element(by.model("first")).sendKeys(a);
element(by.model("second")).sendKeys(b);
element(by.id("gobutton")).click();
}
it('Open Angular js website', function () {
browser.get("https://juliemr.github.io/protractor-demo/");
add(2, 3);
add(4, 6);
add(7, 8);
add(13, 7);
add(11, 14);
//then -promise is resolved only for one item
element.all(by.repeater("result in memory")).count().then(function (text) {
console.log("total record count " + text)
})
//each -promise is resolved for all items
// all and each method , also resolve promise for all element
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)
})
})
})
})