Reputation: 941
my app is currently waiting for an iframe using isElementPresent
then switching to it.
I am now having trouble on the iFrame itself, I need to wait until an input
component is visible on the page and ready to accept keys however if the page loads slow its crashing the app (if the page loads fast it executes the key input on the iFrame component)
error message: ElementNotVisibleError: element not visible
Login.prototype.waitForIframeField = function(){
var self = this;
return this.driver.wait(function waitForInputField() {
return self.driver.isElementPresent(self.page.usernameInputField.selector);
}, this.config.driver.defaultTimeout);
}
I have also tried to use .findElement().isDisplayed()
however it is also performing the same issue with no such element
.
Upvotes: 1
Views: 412
Reputation: 473893
There is a specific elementIsVisible
built-in expected condition:
driver.wait(until.elementIsVisible(driver.findElement(self.page.usernameInputField.selector)));
Note that you might also improve your iframe wait by switching to ableToSwitchToFrame
.
Upvotes: 1