Pytest automated browser keep getting out of fullscreen, when running test in headless mode

53 views Asked by At

I have a test which needs to runs in fullscreen mode of the browser. It is working fine in automated browser. But when running into headless mode. The browser is getting out of fullscreen mode.

I have already tried this solution. But it resets afterward to normal screen.

driver.fullscreen_window()

1

There are 1 answers

0
Hrithik Maurya On

Fixed the issue with using the new chrome headless mode. Just add this new headless option. It will run your test in actual browser like environment

options.add_argument('--headless=new')