Chrome headless mode doesn't support resizing

Hello team,

Chrome headless mode doesn’t seem to support resizing so WebUI.SetViewPortSize wouldn’t work. It might be a good idea support command line parameter for WebUI.OpenBrowser to allow passing --window-size to the browser.

here is a link with the information about chrome not supporting resizing: Headless mode, cannot resize window · Issue #11 · yukinying/chrome-headless-browser-docker · GitHub

Garwin Pryce said:

Hello team,

Chrome headless mode doesn’t seem to support resizing so WebUI.SetViewPortSize wouldn’t work. It might be a good idea support command line parameter for WebUI.OpenBrowser to allow passing --window-size to the browser.

here is a link with the information about chrome not supporting resizing: https://github.com/yukinying/chrome-headless-browser-docker/issues/11

Hi Garwim,

Thanks for this suggestion. I will share the request with the team for consideration.
If you have any further input, feel free to post in the forum.

Thanks again,
Liam

Yes, I have the same problem.

I don’t understand why Katalon can’t support it. Technically, resizing for headless chrome has not much difference from other browser, which are all based on webdriver standard

For me, WebUI.SetViewPortSize worked. But adding window-size param to headless chrome in project setting does not work. So strange

I have solved this problem by adding a customized browser based on Chrome, with params {“CHROME_DRIVER”:{“args”:["–headless","–window-size=1920,1280"]}}, then I can change the window size.

I think the problem that can’t change size for default ‘Chrome (headless)’ of Katalon is a bug for Katalon.

Hi Andy,

This issue has been fixed. It will be available in our next release :slight_smile:

Regards

I have Katalon 6.0.5 and still the same issue
WebUI.maximizeWindow()
is not resizing the Window on Chrome(headless)

@Zarashima

What do you mean by saying this? What fix has happened in which version?

What is the recommended way of setting the window size of Chrome headless mode?

Does WebUI.openBrowser() accepts --window-size parameter?

Do I need to specify Chrome Custom Profile?