Forum Discussion

ashly's avatar
ashly
Champion Level 1
6 months ago

Running UI testcases even if screen is locked

Hi, is it possible to run the UI testcases even if the screen is locked ? I received an error stating that the operation cannot be performed. I am running my test cases(for testing a desktop application) on a remote desktop, and due to company policy, the system will lock after a certain period. This issue prevents me from running the test cases overnight.

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    ashly wrote:

    is it possible to run the UI testcases even if the screen is locked ?

    No. This is not possible. Point.

    This is not a limitation of TestComplete but fundamental behavior of Windows OS.

     

  • ashly's avatar
    ashly
    Champion Level 1

    hi, on referring to the document that rraghvani has given, I have fixed the issue of running UI testcases when the remote desktop is minimized. But when I tried fixing similar issues while disconnecting the remote desktop after referring the below ,  I got some errors. Can you help me in fixing this?

     

    • AlexKaras's avatar
      AlexKaras
      Champion Level 3

      Hi,

      > I got some errors. Can you help me in fixing this?

      You did not provide any information as for what you did and when errors occurred, so just for your information:

      What referred tscon command actually does is that it switches current user session to default admin one. Default admin session has default resolution of 1024x864 or something like that. If your tested application cannot adapt to this resolution, some controls might appear to be out of viewport and clicks on such controls will (obviously) fail.

      To cope with this problem you may (for example) either set required screen resolution before test start (for example, Set Screen Resolution task in Azure DevOps does exactly this, or consider SessionCreator utility provided with TestComplete as recommended by rraghvani), or, instead of clicking on UI objects, focus them first (via .Focus, .SetFocus methods/properties supported by given control) and than press Space or Enter key. Exactly like end-user does when he/she does not use mouse but controls application via keyboard.

      Finally, https://community.smartbear.com/discussions/testcomplete-questions/screen-resolution-of-a-vm-using-rdp-with-testcomplete/136227/replies/136456 thread might help if you decide to set default resolution of admin session to the value required by your tested application.