splinter icon indicating copy to clipboard operation
splinter copied to clipboard

Screenshot using firefox headless doen't see checkbox or radiobutton controls

Open rouilj opened this issue 6 years ago • 3 comments

I am doing a full screen screenshot using:

screenshot_path = self.browser.screenshot('/tmp/your_screenshot', full=True)

The page includes checkboxes and radiobuttons but they are not shown in the screenshot. I can interact with then using find_by_css/xpath and it doesn't matter if they are selected or not.

The browser instance is create with: Browser('firefox', headless=True)

OS: Ubuntu 18.04.5 LTS Python: 3.6.9 splinter: 0.14.0 Pillow: 7.2.0 Firefox: 80.0.1

suggestions on how to get a screenshot of all elements.

Thanks.

-- rouilj

rouilj avatar Sep 19 '20 16:09 rouilj

What happens if you run with headless turned off?

javascript-error avatar Sep 19 '20 18:09 javascript-error

Hello Joshua:

Thanks for responding.

In message cobrateam/splinter/issues/809/[email protected], Joshua Fehler writes:

What happens if you run with headless turned off?

Sorry for the delay. Had to figure out how to log in and let it have a display.

The screen captures display the controls if I run with a head. The checkboxes are shown. However I am running this on a remote system that doesn't have a head.

Also with a head, I am getting an error when trying to check a checkbox:

selenium.common.exceptions.ElementClickInterceptedException: Message: Element is not clickable at point (266,64) because another element obscures it

This did not occur when running headless. I can work around it by changing the order of some click statements. So there may be something else weird here.

I also tried using chrome/chromium. Screenshots do display the controls in headless mode. However the screen size is small enough that it is triggering the websites responsive/tablet mode and not desktop mode.

Does this help?

-- -- rouilj John Rouillard

My employers don't acknowledge my existence much less my opinions.

rouilj avatar Sep 20 '20 04:09 rouilj

Elements not appearing look more like a geckodriver/firefox issue than anything with splinter. We piggyback off selenium for taking the screenshot. Elements overlapping is a page-specific issue. Chromedriver currently appears not to respect window resizing, you'll have to resize the window using javascript.

javascript-error avatar Sep 21 '20 14:09 javascript-error