1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| it('it inject JavaScript to the page', function () { var divCount = browser.selectorExecute("//div", function(divs, message) { return divs.length + message; }, " divs on the page"); console.log(divCount);
var divLinkCount = browser.selectorExecute(["//div", "=Read Post"], function(divs, links) { var message = 'There are ';
message += divs.length + ' divs on the page'; message += ' and '; message += links.length + ' links with an link text "' + links[0].text + '"';
return message; }); console.log(divLinkCount); });
|