Typeerror: Driver.iselementpresent Is Not A Function
I am attempting to write a node function that logs into a website and am having trouble getting it to work. I am trying to wait for the page to load using the isElementPresent fu
Solution 1:
If you're using Selenium 3
, you should try using findElements
instead to determine element present or not as below :-
driver.findElements(By.id('email')).then(found => !!found.length);
Or if you want to wait until desire element present, you should try using webdriver.until
as below :-
constuntil = webdriver.until;
var user = driver.wait(until.elementLocated(By.id('email')), timeout);
user.sendKeys(username);
Solution 2:
Make sure that all of the dependencies like Selenium and the browser driver are installed and working using a very minimal example.
Then you can check what functions are on the driver object with console.log(util.inspect(driver));
If your dependencies are set up, it may be that the API changed slightly. The current example here https://www.npmjs.com/package/selenium-webdriver uses until
. You may want to try something closer to that example first.
Post a Comment for "Typeerror: Driver.iselementpresent Is Not A Function"