1

I'm using Jenkins for run selenium tests on windows slave. Windows slave has windows 2016 OS. For launched slave instance I used ec2 plugin for Jenkins, it uses
winrm protocol for management our nodes. Test executed nice, but screenshot has resolution about 1024*786(I think). But server has resolution 1920*1020. If I did rdp CONNECT TO SLAVE SERVER before begin tests, screenshot will be full size. I added auto-login for my user that use winrm via netplwiz. Didn't help me.
Also I tried: 1. Changed into windows register: DefaultSettings.XResolution,DefaultSettings.YResolution to 1902*1020;

Help me only when I do rdp connect to my server before begin tests.

UPDATE(12.10.2018):

    C:\Users\jenkins>powershell -command "Set-DisplayResolution -Width 1920 -Height 1080 -Force" 
    setres will now attempt to apply the following display settings: 
      Width:          1920
      Height:         1080

The settings passed in could not be applied to the graphics device.
init script ran successfully

I want to make note, I'm using winrm protocol. I founded an interesting article https://serverfault.com/questions/803453/windows-server-2012-default-desktop-size

therefore, maybe reason is in display driver (Hyper-V Video)...

Zak Shirak
  • 89
  • 4
  • 12

3 Answers3

0

If the windows slave is controlled by AD, it can be with custom size. When you connect with RDP, it will take your PC resolution.

Speak with the IT or the person who manage this machine to emulate higher resolution.

Infern0
  • 2,565
  • 1
  • 8
  • 21
  • It is aws instance, single ec2 without domain. – Zak Shirak Oct 07 '18 at 21:48
  • after disconnect of RDP, does it lock the remote machine ? – Infern0 Oct 08 '18 at 06:21
  • I think that didn't lock, because I disconnected from server by windows menu. – Zak Shirak Oct 08 '18 at 10:13
  • Try with this this two solutions: https://support.smartbear.com/testcomplete/docs/testing-with/running/via-rdp/keeping-computer-unlocked.html and/or https://stackoverflow.com/questions/35862217/screen-resolution-changes-for-the-remote-machine-after-safely-closing-the-rdp-se – Infern0 Oct 08 '18 at 10:28
  • This solution is well when I do connect by RDP to my server before launching tests. Thank you. But I don't want do connect rdp for resolved issue. Server master is managing slave via Winrm protocol. Maybe I can setup Resolution for Winrm sessions? – Zak Shirak Oct 09 '18 at 07:43
  • pls see my update in main article - UPDATE(12.10.2018): – Zak Shirak Oct 12 '18 at 13:42
0

@Infern0 thank you very mach,for your help. I resolved my issue when added in plugin that have run ec2 instance and manage nodes by winrm protocol - Data user:

<script>
 Set-DisplayResolution -Width 1920 -Height 1080 -Force
</script>
<persist>true</persist>
Zak Shirak
  • 89
  • 4
  • 12
0

Jenkins plugins can't be used for Selenium tests on Windows when display resolutions is instead 1036*660. Because plugin is working in noninteractive session 0 when use WinRm or ssh as methods for connect to slave.

And we can't influence of this situation.

You can get more information in microsoft docs about CreateProcessAsUserA function.

you can use as example code from github murrayju/CreateProcessAsUser .

Zak Shirak
  • 89
  • 4
  • 12