Forum Discussion

andrewa's avatar
andrewa
Contributor
6 years ago

Detecting (and pausing) on a locked session

So our group has a number of Test Complete tests that have long running database queries. I run the tests on a remote machine and sometimes the machine gets locked (due to a timeout thing) and then all the tests in our suite fail after that test.

 

I've pursued trying to extend the timeout period so that it would be longer than the query that was being called, but the security group doesn't appear to want to let us do that.

 

As an alternative, can Test Complete detect that the user session is locked and wait for it to become unlocked?

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Unfortunately, not really right out of the box...  

    Since the "locked" message shows up as an error in the test log, you may be able to leverage the OnLogError event handler and detect the locked message... when it shows up in the log, execute a "wait" loop, waiting for a desktop or something.

    As to the underlying problem... what architecture is underneath your tests?  Are they running on a Virtual Machine?  If so, you can work with your security team to put an exception on that machine in their group policy and then use tscon to set the machine to be in a "console" session.  This basically means the machine is unlocked but, unless you have access to the host box that is hosting the VM, you can't get to the desktop... just as secure as "locking" the individual machine... this is how we do things.

    Alternatively, if you're running a database query, that means you're not interacting with the desktop... this is probably what's generating the timeout.  What others have done in the past set up a timer object in TestComplete that, every so many seconds, you just move the mouse a bit.