Katalon Studio WebUI local browser viewport/window size

Hello,

I’m a newbie to Katalon Studio and wondering if there is a way to set a default window size for browsers on a local machine as it seems Safari loads in a different window size to Chrome/Firefox.

I have already experimented with Remote Server which sets a screen resolution, but for Katalon Studio is there a way to set WebUI browser size? separate to setting a viewport size in a script.

Tony

You can do it in script for sure. But to alter it outside of a script… not sure. Perhaps Desire Capabilities would be the route to take…

Callout to @Brandon_Hein (re Desired Capabilities)

Hi @Russ_Thomas

Yep, I tested the SetViewPortSize within scripts which works great but if connecting to a remote server which is already going to be configured to have a screen resolution size, it would be nice if I could just set a viewport size globally in Katalon for select browser (local testing) same as remote, instead of having to make sure SetViewPortSize is added to each script.

I did look at Desired Capabilities, but I could not get anything to size browser window following any Katalon docs on WebUI Viewport sizing, I tried various items/values but nothing was working for me.

The only other solution I’m aware of…

1.) Navigate to Project > Settings > Desired Capabilities > WebUI > Chrome:
2.) Click the Add button, and set Name = args, Type = List
3.) Under the Value column, click the ellipses.
4.) In the List Property Builder, click the Add button, then set Type = String, Value = window-size=x,y
5.) Set x,y in the value above to your desired dimensions, for example 1920,1080:

6.) Click OK, then OK again.
7.) Do steps 1-6 for firefox as well.

1 Like

I’ll also add that if you want to just start with the browser maximized (i.e. fit to the dimensions of your main display), add this argument, instead of the window-size=x,y argument:

start-maximized

Hi @Brandon_Hein

That’s so helpful and does work for Chrome/Firefox…Is there a solution for sizing Safari window?

I haven’t worked with Safari, but I believe the same arguments would work.

It didn’t work on Safari, just Chrome & Firefox…I will search about Safari equivalent for sizing.

Thanks again for the above

2 Likes

@Brandon_Hein
For me it doesnt work on either Chrome or Firefox…
I got the latest Webdrivers for both and i`m on KS 7.2.1.

Could you please verify if my settings are right?
image

Edit: Only Firefox isnt Working now

Hello!

I followed all the steps, added it in Chrome and Mozilla but it didn’t work in Chrome browser, see screenshot below:

Is there anything else that I need to change for it to be applied in Chrome?

Thank you in advance!

Type should be “List”, not “String”.

Did we ever figure out what the correct arguments are for Safari? This is really hosing my scripts having such a small Safari window open up. Also, my arguments are the exact same for Firefox as Chrome. However, Firefox does not seem to be respecting them. I guess the arguments are the same for headless Chrome and Firefox, as well?

Hi @Brandon_Hein,

Would these arguements be the same for Microsoft Edge?

Thank you,
Krystal

@eric.martin @krystal.wilczynski

For the most part, each browser will have it’s own set of arguments to control the various settings. Chrome and FF tend to share quite a few, but not all of them. Browsers like Edge, Safarti, etc. are going to be quite different. I’m really only qualified to speak on the Chrome arguments, so you’ll have to do some footwork to find settings for the other browsers.

That’s very helpful information. Thank you, Brandon.

Hi Brandon

my local system resolution is 1920 * 1080 windows 10 but remote server is of windows 7 with 1360* 768. Some test cases fails on running it. Tried above mentioned steps in version 7.2.9 still remains in same resolution and fails.

See this post above:

anyone figure out the args for Safari? Apparenty Safari likes to be the new Internet Explorer.