Closed jsnjack closed 1 year ago
Could you please attach a trace-level log from geckodriver? Read more about reporting actionable bugs in our contribution guidelines.
Sure, I attached them to this message 1684340071071 Marionette.txt
It's not clear to me what's happening on this site - maybe you can help. As it looks like an iframe is getting added by the navigation and that you switch to that frame. Then when trying to find an element it fails initially because it is added lazily to the DOM? Surprisingly then the iframe gets destroyed and the find element call fails as expected with no such window
. But then a screenshot seems to be taken and it fails with the unknown error instead of no such window
.
So I have two questions:
WebDriver:TakeScreenshot
command or other commands affected as well in not correctly reporting no such window
?I can actually see the failure when the currently selected frame is removed before taking a screenshot. This is because we inappropriately try to screenshot the child browsing context but not the top-level one as given by the spec. There is bug 1493650 which covers that.
Nevertheless I would be still interested to see what's going on for this page and why the iframe is getting removed.
We have many tests which follow the following pattern
wd.get(<url>)
, it loads the main page which has the iframe with the following selector [name=_surfly_tab0]
body > h1
element inside this iframeReading the logs again, after your comment, I think that the problem is indeed in [name=_surfly_tab0]
iframe being removed.
Adding sleep(1)
solves the problem because, I think, the iframe is recreated in this short period? :thinking:
We run the same test also in Chrome and it doesn't have this iframe create/remove/create problem.
Switching to the default context will fix the screenshot problem, but it seems the the real problem is the iframe.
Was able to track it to our frontend framework, which deletes and creates iframe in a very short period of time. Not sure what made the problem more "obvious" in Firefox 113, but it is the problem on our side!
Thanks for the help!
Good to know and thanks for the remaining investigation. Basically all the other commands beside taking a screenshot should work given that those use the correct browsing context check. Only the screenshot command is broken and we are still going to fix that via bug 1493650.
System
Testcase
Since firefox released v113 we have been having a lot of problems with the test stability. It seems that firefox loses the reference to window object. Our logs are full of the following log messages
TypeError: browsingContext.currentWindowGlobal is null
Code that fails often:
We developed a "workaround" for this issue:
Stacktrace
Trace-level log