Protractor isDisplayed()
method is failing with Timeout Error
when object is not displayed on the page.
Same issue exists with isPresent()
.
Below is the code snippet:
public async checkifelementisdisplayed(webElmntXpath: string) {
let webElement = (element(by.xpath(webElmntXpath)));
try {`enter code here`
const eleStat = await webElement.isDisplayed(); //Tried with isPresent() as well
console.log("element status is "+eleStat);
if (eleStat) {
return true;
}
else {
return false;
}
} catch (e) {
return false;
}
}
Error: function timed out, ensure the promise resolves within 60000 milliseconds at Timeout._onTimeout (C:\UIAutomation\node_modules\cucumber\lib\user_code_runner.js:76:18) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7)