how can I access iframe with random generated name using nightmare-iframe plugin?
I have tried
var name = yield nightmare
.goto(defaultUrl)
.click('.btn-login')
.wait('iframe')
.evaluate(function() {
return document.getElementsByTagName('iframe');
});
yield nightmare.use(iframe.withFrameName(name, function(IFnightmare) {
IFnightmare
.type('input[name=username]', 'username')
.type('input[name=password]', 'password')
.click('button[type=submit]')
}))
but this code ends with - TypeError: Cannot read property 'switchToFrame' of undefined