Failed: protractor_1.browser.driver.isElementPresent is not a function
Hi, Found a new issue while using the browser.driver.isElementPresent. It was used inorder to avoid the sleep problem but still it shows an error ? Protractor version : 5.2.2 npm version : 5.5.1 node version : v8.9.3
this.testFunction= function() { var test= element(by.id('getID')); this.isLoaded(test); }; this.isLoaded = function (locator) { console.log("entered...1"); browser.wait(function () { console.log("entered...2") return browser.driver.isElementPresent(locator); //Here it shows the error },5000); };
Anybody help ?
Try return element(locator).isPresent();
e.g return element(by.css('.test-h1')).isPresent();
http://www.protractortest.org/#/api?view=ElementFinder.prototype.isPresent