Can someone tell me how to proceed with referencing an element within an iframe after the switching of frames is done? I've already looked at the solution presented in How to switch iframes InternJS to no avail, and the information in intern Functional Testing with Frames is just not applicable (yet.) The following script returns an error of Cannot read property 'apply' of undefined type: TypeError
:
return Remote
.findAllByTagName('iframe')
.then(function (frames) {
return new Remote.constructor(Remote.session)
.switchToFrame(frames[0])
.getProperty('title')
.then(function (result) {
expect(result).to.equal('Rich text editor, rtDescAttach');
});
});
The only reason I can see that the script is failing is that the frame was not located correctly. There are two on the page and I need the first one. Once this is done I'd really like to put the reference to the frame in a page object (which is where I feel it belongs) but I have to be able to successfully locate it first, so no putting the cart before the horse. Suggestions and help greatly appreciated.