I found a workaround using Selenium Grid , instead of running the browser on local machine.
Change display resolution on remote execution
-
01-06-2022 - |
문제
I'm executing Selenium webdriver tests on remote test server using powershell script (from Jenkins CI server hosted on Windows server 2008r2, on Windows server 2012 target machine, if it is important). I want to change the default display resolution.
QRes console utility tells me that only 1024x768 resolution is available (qres /s command).
Is there ideas to increase the display resolution, let us say, to 1920x1080? May be the resolution is stored somewhere in registry? May be there is a way to emulate the video card?
P.S. It is enough to change the resolution for one time, no dynamic change of resolution required.
UPD: I'm using powershell remoting session. No, it is not looks like RDP session.
Example: powershell .\run.ps1
where run.ps1 looks like:
$sc = {
#this code section is executed on remote computer.
#it runs firefox.exe, chrome.exe, making snapshots, etc.
powershell C:\path\on\remote\server\run-tests.ps1
}
Invoke-Command -ComputerName "SEPER-TEST-SERVER" -ScriptBlock $sc
One of the troubles I don't event understand what the video device it actually using, but I can create snapshots, etc. May be, there is a man who can explain me how it is actually working:)).
I want to find the how to change the display (virtual display?) resolution once. It can be script, registry change, etc.
해결책
다른 팁
@2xmax: If I read your original question correctly, I believe that you wanted to set the screen resolution to a larger size to eliminate the following errors from your end 2 end tests.
"Element is not clickable at point (996, 92)"
or other such error that occurs because the element that you want is off screen. I am having the same problems with my end 2 end tests.
I am unclear on how using "Selenium Grid" solved your problem. Can you please elaborate so that I can follow your example? Thanks.