WebDriver:TakeScreenshot captures current frame instead of top-level browsing context
Categories
(Remote Protocol :: Marionette, defect, P3)
Tracking
(Not tracked)
People
(Reporter: ato, Unassigned, NeedInfo)
References
(Blocks 1 open bug)
Details
Reporter | ||
Updated•6 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 1•2 years ago
|
||
The problem those days can be seen here:
https://searchfox.org/mozilla-central/rev/065102493dfc49234120c37fc6a334a5b1d86d9e/remote/marionette/driver.sys.mjs#2459,2473
We basically need to use the top-level browsing context when getting the actor (as we also initially assert for).
What's interesting that the test_no_browsing_context test is not failing given that the current frame has been removed. See also another related GitHub issue.
Lets discuss the priority of this in a triage meeting.
Updated•2 years ago
|
Updated•2 years ago
|
Comment 2•2 years ago
|
||
So there can also be a security security error if the screenshot is taken from the iframe:
https://github.com/mozilla/geckodriver/issues/2068
A testcase for that can be found at: https://github.com/nightwatchjs/nightwatch/issues/3512
Comment 3•2 years ago
|
||
Hi Victoria, as we spoke on Matrix I wonder if you would still be interested on this bug. Or given that it includes Python additions / changes you would like to have a JS only one? Thanks for letting me know.
Comment 4•2 years ago
|
||
Hello @whimboo, sorry fro the delay. I'm still working on this issue and I would be attaching a patch soon.
Comment 5•1 years ago
|
||
As discussed with Victoria, she is working on a different bug now. So this one is free again for pickup. Also adding lang=py given that the required tests need to be written in Python.
Hi,
So, while running some initial tests with selenium and geckodriver from the latest build of Mozilla, the screenshot command seems to be functioning correctly,
My system specs are:
- OS: Windows 10 - version 10.0.19045 Build 19045
- Firefox Version: 118.0a1 (2023-08-26)
- Geckodriver Version: 0.33.0
- Selenium Version: 4.11.2
Even after switching frame to an iframe component (current context), the save_screenshot() returned an image of complete web page (the top context)
Also, while taking a screen shot of an element from the url https://the-internet.herokuapp.com/nested_frames , the program didn't return any security errors. (reference to : https://github.com/mozilla/geckodriver/issues/2068 )
Comment 9•1 year ago
|
||
Sorry, but I forgot to remove the mentored flag after Mitesh commented recently. There is most likely no further work needed here and I have to verify that.
Daniel, if you want to contribute maybe you could take bug 1838152? If you are interested please let Sasha know over on that mentioned bug. Thanks!
Description
•