Closed mittster closed 10 months ago
Looks like related to https://github.com/microsoft/playwright/issues/28966 and https://github.com/microsoft/playwright/issues/28082
The test itself is flaky in a few places, most of the times it prints 'parsed src: <!DO'. Sometimes it finds the frame but sometimes fails apparently due to frame not completely loaded. There is also cloudflare page in between which is shown when the script tries to find the frame. Inserting a delay before page.frame call makes it work in many cases:
await new Promise(resolve => setTimeout(resolve, 2000));
let iframe = page.frame({url:iframeSrc}); // returns null when firefox is used, but it works with WebKit and Chromium
So far it looks like just a flaky test. If you think this is bug in playwright, please provide a reduced repro.
Closing per the response above, feel free to open a new issue if it doesn't work.
System info
Source code
Steps
Expected
page.frame({url:iframesrc})
is expected to return a Frame object.Frame objects returned by
page.frames()
should return an url when byFrame.url()
method is callActual
page.frame({url:iframesrc})
returns null, even though iframe src is correct. Frame.url() does not return a iframe src url.This only happens with firefox. I think the iframe used by CF is special, because I was not able to reproduce the issue on this website: https://ui.vision/demo/webtest/frames/
The error may have something to do with the iframe attributes.
allow="cross-origin-isolated; fullscreen"
is mentioned in other issues, not sure if this is the same problem.