0

I have a number of tests in an E2E suite where a video element is fullscreened and the fullscreen status is verified. However, when running the suite headlessly, these tests fail. Screenshots of the page show the video is simply not in fullscreen, even after the fullscreen button is clicked. Is there a way to achieve fullscreen functionality in headless Chrome?

Here is an example of the capabilities in my config.

capabilities: [
    {
        'browserName': 'chrome',
        'goog:chromeOptions': {
            args: ['headless']
        }
    }
]
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • 2
    Duplicate of [How to set window-size to fullscreen for headless-chrome using chrome options?](https://stackoverflow.com/questions/44796194/how-to-set-window-size-to-fullscreen-for-headless-chrome-using-chrome-options) You can't run headless if you want full-screen capability. – Ouroborus Nov 17 '20 at 01:25

1 Answers1

0

When the argument --start-fullscreen is added to initialize in normal mode it seems the screen size is:

1366 x 724px

Snapshot:

visible--start-fullscreen


Whilst when initiated additionally with either of the arguments:

  • --start-maximized
  • --kiosk
  • --start-fullscreen

The resultant screen size is always:

800 x 600px

Snapshot:

using--start-fullscreen


Conclusion

So it can be concluded that in --headless mode Chrome browser always opens in 800 x 600px size ignoring the customized --window-size arguments.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • 1
    I was not referring to the `--window-size` argument, but rather entering fullscreen during the test run, by clicking a fullscreen button on a video. Though my question wasn't answered directly, this makes me think it is not possible to achieve this. – Alex Sandridge Nov 18 '20 at 21:02