You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
const baseURL = "about:blank";
// Open up a new tab
let mainTab = await browser.newTab();
//inject iframe into this tab - (iframetester creates an Iframe and injects it into the DOM
const iframe = await mainTab.evaluate(iframeTester, "http://www.exampleURL.com");
await mainTab.waitForFrameToLoad(baseURL, 5000); // Should be waiting for iframe to load for this
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 as Page.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
The text was updated successfully, but these errors were encountered:
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=asyncfunction(){debug(`:: getFrames => Getting frames list`)browserIsInitialized.call(this)constframes=[]constresourceTree=awaitthis.client.Page.getResourceTree()frames.push(resourceTree.frameTree.frame)_.each(resourceTree.frameTree.childFrames,(frameObj)=>{frames.push(frameObj.frame)})returnframes}
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.
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
The text was updated successfully, but these errors were encountered: