urlIs() in protractor ?
- urlIs() will verify the current web page url equals to a given string.
- If url not equals to given string in given time, it will throw time out error.
- url should be case-sensitive.
Please check below code script:
First check the page url
Navigate to https://keeplearners.blogspot.com/
describe('Protractor - waits - urlIs()', function () {
beforeAll(async function () {
await browser.get("https://keeplearners.blogspot.com/");
});
it('Code script to use waits - urlIs() in protractor', async function () {
var EC = protractor.ExpectedConditions;
await browser.wait(EC.urlIs("https://keeplearners.blogspot.com/"), 5000, "expected url is not equals to actual url");
await console.log("Current page url verified");
});
});
No comments:
Post a Comment
Please comment below to feedback or ask questions.