-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocatorByRepeater.js
More file actions
57 lines (41 loc) · 1.76 KB
/
LocatorByRepeater.js
File metadata and controls
57 lines (41 loc) · 1.76 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
describe("Locator testing By Repeater => ", () => {
it("Adding few records in a table", () => {
browser.get("http://www.way2automation.com/angularjs-protractor/calc/");
element(by.model("first")).sendKeys("5");
element(by.model("second")).sendKeys("7");
element(by.id("gobutton")).click();
element(by.model("first")).sendKeys("4");
element(by.model("second")).sendKeys("6");
element(by.id("gobutton")).click();
});
it("Printing the first row data", () => {
console.log("Printing the first row data");
element(by.repeater("result in memory").row(0)).getText().then((text) => {
console.log(text);
});
});
it("Printing the first column data", () => {
console.log("Printing the first column data");
element.all(by.repeater("result in memory").column("result.timestamp")).getText().then((text) => {
console.log(text);
});
});
it("Printing the entire table data", () => {
console.log("Printing the entire table data");
element.all(by.repeater("result in memory")).getText().then((text) => {
console.log(text);
});
});
it("Printing the the entire table data in new line", () => {
console.log("Printing the entire table data in new line");
element.all(by.repeater("result in memory")).getText().then((rows) => {
let noOfItems = rows.lenght;
for(let i=0; i<noOfItems; i++){
let table = element(by.repeater("result in memory").row(i)).getText();
table.then((text) => {
console.log(text);
});
}
});
})
})