Forum Discussion

rushikesh's avatar
rushikesh
Contributor
7 years ago

How to login into a system using Test Complete.

Hi,

 

I have few scripts which I would like to run in morning 5 am through task scheduler, at this time system is locked.

 

From my observation Test Complete requires Screen to be unlocked to identify the test objects.

 

Is there a way to unlock system by Test complete ? if not by any other means ?

 

Any help is appreciated. 

2 Replies

  • karkadil's avatar
    karkadil
    Valued Contributor

    The simple answer: it is impossible to unlock the workstation from TestComplete, but there are several workarounds. The most obvious one: do not lock the computer. Usually the simplest solution is the best. If for some reasons you can't do it, try reading the following article

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    > Test Complete requires Screen to be unlocked to identify the test objects.

    This is not TestComplete's requirement, but the generic behavior of Windows OS - the OS just does not provide the application with the desktop where application's UI can be drawn if workstation is locked. Otherwise, if the interaction with UI is not required, TestComplete runs fine and executes script code without any problem on the locked workstation (e.g. if script code operates with command line utilities and/or COM objects only).

     

    Gennadiy is correct - Windows OS does not provide means to unlock locked workstation by some automation code, thus you must not lock the workstation. If it is a security policy enforcement, you may consider dedicated test box without the display (or, better, virtual machine) accessed via remote desktop (RDP). Using RDP you will provide active user session where your tests will be started via scheduler and switch then this session to desktop (https://support.smartbear.com/testcomplete/docs/testing-with/running/via-rdp/keeping-computer-unlocked.html). This will result in active user session while keeping workstation's desktop not easily accessible to others.

    .RebootAndContinue() method exists if you need to reboot test box from test (https://support.smartbear.com/testcomplete/docs/testing-with/running/rebooting-computer.html).