How do I maximize Browser while running Katalon script through Jenkins?

How do I maximize Browser while running Katalon script through Jenkins ?

I am noticing that the WebUI.maximizeWindow() doesn’t make any difference on Linux Server with Jenkins.

If you always want to start with a maximized browser, you should handle this with a desired capability. That way you don’t have to call WebUI.maximizeWindow() in every single script. This is how to do it for chrome:

1.) Open Project > Settings > Desired Capabilities > WebUI > Chrome:

2.) Click “Add”, and set Name to “args”, Type to “List”, then click on the ellipses:

3.) In the list property builder, set Value to “–start-maximized”:

image

4.) Apply all your settings and run your script.

2 Likes

@Brandon_Hein Thanks for sharing this. I have another question. I want to enable my scripts to work on Mobile, Tab and Desktop. The state in which they are currently in work well on desktop but they fail when I run on Mobile or Tablet device. The reason is that some of the elements I am interacting within the script show up on the desktop view but not on the Mobile View or Tablet View. I was wondering if I can do something like if statement that basically verifies if the screen size is this then do this or if there is another way I can do the same?

Mobile testing is outside of my skillset. I know that @Chris_Trevarthen knows more about that type of testing.

I wouldn’t see why not. I use if statements for environments, so I would assume that you could use the get viewport width/height webUI keyword and then form your if statement there. But, be careful, because sometimes clicks, etc are different so you’ll want to use a mobileUI keyword in those cases.

3 Likes

@Amanda_Perkins1 Thanks, I just want to run the scripts on Mobile Browser. Do I need MobileUI Keywords there as well ?

Possibly, since mobile browsers are still responsive to touch rather than mouse click. You could definitely try it out and see and then adjust as necessary. I know with our mobile app we have to use the mobileUI keywords, I’ve not tried it with mobile browsers at this point. Let me know what you find out!!

1 Like

@Amanda_Perkins1 Sure I will update here, Getting scripts working across all type of user devices is my next project.