Forum Discussion

ArunKarunakaran's avatar
ArunKarunakaran
Occasional Contributor
5 years ago

The sessioncreator.exe doesn't sets the screenresolution of RDP when the RDP is disconnected.

I have been using TestComplete and TestExecute over Jenkins with the jenkins plugin for testcomplete quite sometime. I observe a wierd issue with testcomplete when run from CI jenkins with the below conditions,
1. When I set the screen resolution similar to that of the RDP machine's resolution.
2. With not using active session checkbox
3. when I have logged off from my RDP system.
I notice when I run the tests with above conditions it by default only runs for 1280*1024, whereas my RDP system resolution is 3840*2160. Because of which all my test fails. I have sorted out this to be a wierd behavior as it is observed only when I have either disconnected from remote session or logged off. I have followed strict testcomplete documentation for running over CI for testcomplete. It tells the same stories again and again but does not provides a solution. I have tried various other ways even my using command-line over jenkins: sessioncreator.exe /RunTest /Username:"username" /password:password /ScreenResolution:"3840*2160"
But still the actual results produced is with that of system resolution 1280*1024. Why by default it sets to 1280*1024 when the RDP machine is closed?
I have posted this over community forum but I have been pointed out to different sections and I see I have been only spending much time into it and it doesn't fixes my issue. I see that this /screenresolution setting doesn't seems to make a point here, because to whatever value you set it. It by default sets it to 1280*1024 when the RDP session is either logged off or disconnected.

Note: I always want to either disconnect or loggoff the user session and I cannot keep the session always open as I am implementing a continuous integration/CD test system using testcomplete. The above scenario works fine when the RDP session  is not disconnected and the /screenresolution setting works fine. The issue is only when the RDP session is disconnected or logged off.

Also I see that there is a know issue /useactivesession hope if this gets resolved it might resolve my issue. But for now please provide me a suggestion and quick fix for my issue.

    • ArunKarunakaran's avatar
      ArunKarunakaran
      Occasional Contributor

      I did not solve the problem. I have written to SmartBear Customer Care about the Issue and Alexander Ivanov is looking at the issue.

      Please find the mail trail details as below,

       

      *****************************************************************************************************************

      From: Arun Karunakaran
      Sent: 21 May 2020 20:25
      To: SmartBear Customer Care <customercare@smartbear.com>
      Subject: RE: Case #00437001: Unable to change set the screenresolution for RDP while running from jenkins

      Hi Alexander,

       

      Thanks for writing!

      I have provided answers to your questions below in the mail thread. And you can see them highlighted below.

       

      I have configured the slave node over a virtual machine and the OS is windows 10. I have a similar setup even on Windows server 19

       

      As far as Jenkins plugin is considered I have configured the setup correctly. Because I don’t see any issues while executing the Jenkins build when I am logged into the remote virtual machine window with active session on. I see all the tests running perfectly fine. I used the disconnect.bat which contains the following script to disconnect from the VM,

      for /f "skip=1 tokens=3" %%s in ('C:\Windows\System32\query.exe user %USERNAME%') do (

        %windir%\System32\tscon.exe %%s /dest:console

      )

       

      And with active session off I ran the testcomplete execution.

      I have used the jenkins plugin setup I have configured for testcomplete execution with active session off ,

       

      When I do this. The tests runs but with the session screen resolution defaulted to 1280*1024. I don’t see a way to alter this though I am setting the dropdown of screen resolution to 3840*2160. This results with the comparison of actual and expected images result failures. There is a variation of the height and width of the images. Following this I did a second run with the remote machine connected during the run and I see all the images matching as expected. As of now I am automating by scheduling a task scheduler job that runs just before this Jenkins build job and keeps the VM connected so that my test passes. But I want to figure out a way from the Jenkins itself to run the tests for the said resolution of 3840*2160 even when the VM is not connected. Please note that I am not locking out the VM but I am only just disconnecting it using the bat script. Which clearly says that the tests should run for the resolution 3840*2160 but it doesn’t. I need a solution to fix this particular step alone.

      Please guide me if you can see through it. Thanks!

       

      Regards,

      Arun K

      ********************************************************************************************************

      From: SmartBear Customer Care <customercare@smartbear.com>
      Sent: 19 May 2020 18:53
      To: Arun Karunakaran 
      Subject: Case #00437001: Unable to change set the screenresolution for RDP while running from jenkins

       

      Hi Arun,

      Thanks for reaching out.

      I believe this resolution is your console session resolution. I am not sure where it is specified and whether it can be changed as my attempts to do so were not successful. I believe it scales with your DPI which, I suppose, is set to 200% for you, right?

      When you already have a session open on this machine, I believe it stores the correct resolution and DPI which should be reused if you use the /useactivesession switch. On the other hand, these preconditions should not affect the process if you do not use this switch.

      Anyway, when running tests though Jenkins, you are supposed to use our Jenkins integration unless you have a solid reason not to. The SessionCreator utility is needed for cases where there is no more specific solution. The Jenkins integration uses the same internal mechanism to create sessions, but it still would be more correct in this scenario. 

      Please take a screenshot of your TestComplete step in your Jenkins configuration. Make sure to expand the Advanced session of this step.

      Also, please enable "This project is parameterized" in your build settings and add a new Boolean parameter of TESTCOMPLETE_PLUGIN_DEBUG and set it to true. Run your build again and share the full Console output with me. ----This is condition is set but I cannot share the console output as it is restricted for me to do so.

      What are the exact OS version and build on the slave machine? ---OS versions is Windows 10

      Does it have a physical monitor connected to it?  ---I don’t have a physical monitor connected to the virtual machine

      Is it a physical or virtual machine?  ---The machine is a virtual machine

       

      Regards,
      Alexander Ivanov
      Customer Care Engineer


      To upload large files to your case,
      click here.

      Ask questions, share experience, build reputation, have fun in our Community!
      »  
      http://community.smartbear.com
       

      Please do not remove this case id: ref:_00D708FQP._5001O1lAqWL:ref

       

      ******************************************************************************************************************

      From: Arun K
      Submitted: Tue, 19 May 2020 11:22:03 +0300
      Subject: Unable to change set the screenresolution for RDP while running from jenkins
       

      I have been using TestComplete and TestExecute over Jenkins with the jenkins plugin for testcomplete quite sometime. I observe a wierd issue with testcomplete when run from CI jenkins with the below conditions,
      1. When I set the screen resolution similar to that of the RDP machine's resolution.
      2. With not using active session checkbox
      3. when I have logged off from my RDP system.
      I notice when I run the tests with above conditions it by default only runs for 1280*1024, whereas my RDP system resolution is 3840*2160. Because of which all my test fails. I have sorted out this to be a wierd behavior as it is observed only when I have either disconnected from remote session or logged off. I have followed strict testcomplete documentation for running over CI for testcomplete. It tells the same stories again and again but does not provides a solution. I have tried various other ways even my using command-line over jenkins: sessioncreator.exe /RunTest /Username:"username" /password:password /ScreenResolution:"3840*2160"
      But still the actual results produced is with that of system resolution 1280*1024. Why by default it sets to 1280*1024 when the RDP machine is closed?
      I have posted this over community forum but I have been pointed out to different sections and I see I have been only spending much time into it and it doesn't fixes my issue. I see that this /screenresolution setting doesn't seems to make a point here, because to whatever value you set it. It by default sets it to 1280*1024 when the RDP session is either logged off or disconnected.
      Also I see that there is a know issue /useactivesession hope if this gets resolved it might resolve my issue. But Please provide me a suggestion and quick fix for my issue.

      ---------------------------------------------------------
      Situational Questions:

      Q: What is the type of your request?
      A: Technical Inquiry

      Q: When does the problem occur?
      A: Command line / COM API / SDK usage

      Q: What is the problem?
      A: Other problem
      Requested info: * Record a video demonstrating the problem and attach it to your query.
      * Or, provide us with a number of screenshots fully demonstrating the problem.
      * Describe the expected and the actual behavior so we understand the difference.

      Q: How many of your usage scenarios cause the issue?
      A: All scenarios

       

      ******************************************************************************************************************

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

         I used the disconnect.bat which contains the following script to disconnect from the VM, [...]

        > \tscon.exe %%s /dest:console

        As the filename and code implies, this command does not close RDP session but switches it to default console one (exactly as Alexander wrote to you). Resolution of this session is set by Windows setup program during Windows install.

         

        P.S. I seem to remember that there was a thread there that mentioned how to change default resolution via registry edit, but don't have the link at hand at the moment...