Open mmarsella opened 7 years ago
Hello @mmarsella !
I think that this case won't work with waitForFrameToLoad, because that method uses the function above, which tries to seek the frames in the resource tree of the page:
/**
* Get the list of frames in the loaded page
* @return {object} - List of frames, with childFrames
*/
exports.getFrames = async function () {
debug(`:: getFrames => Getting frames list`)
browserIsInitialized.call(this)
const frames = []
const resourceTree = await this.client.Page.getResourceTree()
frames.push(resourceTree.frameTree.frame)
_.each(resourceTree.frameTree.childFrames, (frameObj) => {
frames.push(frameObj.frame)
})
return frames
}
What I mean with this is that I'm not sure if you can dynamically add a frame and hope for the getFrames method to find it in the resourceTree.
I'll be glad to test your case if you can help me, just give me the iframeTester
fn that you're using so we can create a test case for this and debug it.
Thanks! Lucho
Ok, will mock up an example and send it over when I get some free time later.
Thanks Lucho.
M
I am trying to inject an iframe into a new tab and need to wait for it to finish loading before proceeding. In the example below I am trying to use waitForFrameToLoad:
The goal is to inject an iframe and wait until it has fully loaded to take next actions. The
mainTab.waitForFrameToLoad
doesn't throw an error, but doesn't seem to be waiting - ideally I would want to be listening for any changes in the DOM (as well as if the src inside the iframe busts out/etc...)- Is there support for page listeners such asPage.loadEventFired
as well as the other Page domain listeners? How would I be able to implement these listeners using your library?Thanks so much.
M