the UI I am testing is using an iframe. I am trying to switch to that iframe with the ".frame(0)" call.
module.exports = {
"test" : function (browser) {
browser
.url("my_url")
.waitForElementVisible(".frame-application-scroll-wrapper", 30000)
.frame(0)
.waitForElementPresent("#page-content", 30000)
.end();
}
};
However, #page-content is never seen which makes me think that the change frame command did not work (but returns no error neither).
Any ideas?
Thanks, Paul
Latest version of nightwatch is
.frameParent()
instead of.frame(null)
to get back to the parent document, just in case any one else finds this post :)as Neoaptt mentioned (Thanks!) the issue was that the iframe element was either not present or not loaded. Adding a pause solved my issue.
By the way, if you want to exit the selected frame you should use ".frame(null)"
What also helped me to debug was to use the --verbose option, for example:
This will display in your terminal all the data exchanged between nodejs and selenium.
Thanks, Paul