Xvfb Screen resolution

Hi,

how can I integrate Screen Resolution in XVFB?
What I try to achieve is that I start my tests in desktop breakpoint. Without the parameter it is mobile breakpoint. And I want to receive images in Testops to visibly track the behaviour of the testruns.

When I use

image: katalonstudio/katalon
#services:

- docker:dind

stages:

  • test

test_job:
stage: test
tags:
- sf-testing
script:
- xvfb-run -a -n 0 -s “-screen 0 1920x1080x24” katalonc -browserType=“Chrome” -retry=0 -statusDelay=15 -testSuitePath=“Test Suites/Final/CC/F09-Payment” -projectPath=“/srv/builds/sf/qa/test-sf/test-sf.prj” -apikey=“$APIKEY” -noSplash -runMode=console --config -webui.autoUpdateDrivers=true -executionProfile=“default” -orgID=11111 -testOpsProjectId=55555 -maxFailedTests=1
artifacts:
name: “$CI_COMMIT_REF_NAME”
paths:
- report/
reports:
junit:
- ‘report/*.xml’
when: manual

I receive

Starting ChromeDriver 97.0.4692.36 

[220]Only local connections are allowed.

[221]Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.

[222]ChromeDriver was started successfully.

[223][1643361215.906][SEVERE]: bind() failed: Cannot assign requested address (99)

[224]org.openqa.selenium.remote.ProtocolHandshake createSession

[225]INFO: Detected dialect: W3C 

[271] ERROR c.k.k.core.keyword.internal.KeywordMain  - ? Unable to navigate to URL

[312] Caused by: org.openqa.selenium.WebDriverException: chrome not reachable

If I change the resolution from " to ’

- xvfb-run -a -n 0 -s '-screen 0 1920x1080x24' katalonc

The problem is:

Starting ChromeDriver 97.0.4692.36 

[220]Only local connections are allowed.

[221]Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.

[222][SEVERE]: bind() failed: Cannot assChirgonm erDerqiuveesrt ewda sa dsdtraerstse sucessfully.

[224]Jan 28, 2022 10:21:16 AM org.openqa.selenium.remote.ProtocolHandshake createSession

[225]INFO: Detected dialect: W3C

[312]Caused by: org.openqa.selenium.WebDriverException: unknown error: session deleted because of page crash

[313]from tab crashed

Was there ever a resolution found to this?
I’m having the same need/issue and I’ve attempted to override xvfb-run -s ‘-screen 0 1024x768x24’ multiple ways, from the command line arguments to WebUI.setViewPortSize(1920,1080) in the test script, and including manipulating the chromeDriver session after run time. Still unable to set a larger display resolution to get to all the elements needed. Your help will be greatly appreciated.
Thank you

After some digging I found the following solution worked for my setup. Issue: Needed solution for xvfb-run -s ‘-screen 0 1024x768x24’ resolution settings Symptoms: Screen Shot of failure showed what appeared to be dimensions of 1024x768x24, missing elements from the viewport displayed per on failure “Full Page Screen Shot”, not expected responsive layout.
What I did to configure the correct display settings 1. Modify the project setting >> Desired Capabilities >> Web UI >> Chrome and add an argument for --window-size=1280,1024 2. Make sure that in the docker run command that the --viewport is set: docker container run --rm -v “$(pwd)”:/li-test image_name katalonc.sh -noSplash -runMode=console --viewport=“1280x1024” , and 3. Make sure there are not any uses of WebUI.maximizeWindow() in test scripts. I had noticed that this (WebUI.maximizeWindow()) was referenced in the main script and causing / reverting the display issue.

Thanks for sharing