Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change the default resolution for UI testing with jenkins

I'm trying to run UI automation with a Jenkins job that runs on a windows VM as a jenkins slave, as a part of a CI pipeline. I have a problem that the screen resolution is set to be very low (1024, 768) how can I change the default resolution, so that when jenkins opens a new connection it will be with a larger resolution?

like image 851
ifatfle Avatar asked Jun 19 '14 08:06

ifatfle


1 Answers

If your UI automation involves running Chrome, you might find it helpful to run Headless Chrome. That way, the screen resolution of the slave won't matter as you can specify the resolution you want to be used.

I was able to achieve this with these Chrome startup arguments running on a Windows Server Jenkins slave:

--headless --window-size=1920,1080

In my case, with Nightwatch, this is a snippet of the nightwatch.json file:

  "desiredCapabilities": {
    "browserName": "chrome",
    "chromeOptions": {
      "args": ["--window-size=1920,1080", "--headless"]
    },
  // ...
like image 64
joshden Avatar answered Sep 30 '22 22:09

joshden