Problem with screen resolution on a Windows remote server when running Katalon tests

Hi guys!
Tell me, did anyone encounter the problem of running tests on a remote Azure virtual machine?
I have a set of tests that I want to run in TeamCity. But the remote machine has a resolution of 1024x768. Can we somehow influence the resolution?
I tried to launch Chrome_Headless with the settings --window-size = 1920,1080. But the tests failed, and I see screenshots with a resolution of 1024x768.
I know that TeamCity works with the server using the TeamCity Build Agent service. But the service cannot affect the screen resolution.
Found the following solution: http://www.voip-lab.ru/screen-resolution-in-selenium-tests-in-teamcity/
This does not suit us, since we should always have a connection through RDP. And accordingly, after restarting the server, you must reconnect and leave the session active
Can I write tests without being tied to screen coordinates?

1 Like

Yes, I have. Its not just with remote server. applicable to any machines with different resolution. the solution i implemented is to set the screen size and zoom level of the browser.

1 Like

I also thought about it … but it seems to me that this is somehow not right …
Can you give some example of your solution?
Thank you in advance!

driver.manage().window().setSize(new Dimension(1530,818))
driver.findElement(By.tagName(“html”)).sendKeys(Keys.chord(Keys.CONTROL, “0”));

The above works for me

1 Like

@Manu_Mahendran Thank you very much for your help! It really helped.
Also such solution WebUI.setViewPortSize(1920,1080) helped me.
Just set the size of the current window in your test.

1 Like