Having some trouble working with Selenium/Chromedriver via Protractor. I try to switch to an iframe, wait for the contents to load, and then manipulate elements inside it. However, the program doesn't seem to recognize when the content has loaded.
browser.driver.switchTo().frame("myView");
browser.driver.wait(function() {
return browser.driver.isElementPresent(by.id("myDiv"))
.then(function (isPresent) {
return isPresent;
});
}, 20000, "Taking too long to load!");
The element myDiv should be present within 20 seconds, but the wait() function times out.
I also attempted using browser.driver.findElement(), with no success.
I made sure to update to Chromedriver 2.21 as well.
Any suggestions on what else could be causing this issue?
Update: Upon checking the error log, here's what is displayed...
Message:
Error: Taking too long to load!
Wait timed out after 20069ms
Stacktrace:
Error: Taking too long to load!
Wait timed out after 20069ms
==== async task ====
Taking too long to load!
at /Users/me/Documents/My-Test/specs/myWorkflow.js:82:20
==== async task ====
at [object Object].<anonymous> (/Users/me/Documents/My-Test/specs/myWorkflow.js:79:14)
==== async task ====
Asynchronous test function: it()
Error
at [object Object].<anonymous> (/Users/me/Documents/My-Test/specs/myWorkflow.js:7:5)
at Object.<anonymous> (/Users/me/Documents/My-Test/specs/myWorkflow.js:5:1)