getPageSource() in protractor ?
>> In protractor, we can get HTML code (source code) of a web page using getPageSource() method.
Please check below code script:
describe('Protractor - getPageSource()', function () {
it('Code script to use getPageSource() in protractor', function () {
browser.get("https://keeplearners.blogspot.com/2018/03/Angular-elements.html");
browser.getPageSource().then(function (text) {
console.log("Text=" + text);
});
});
});
Output:
getPageSource() |
Please comment below to feedback or ask questions.
No comments:
Post a Comment
Please comment below to feedback or ask questions.