Forum Discussion

BigDuy01's avatar
BigDuy01
New Contributor
8 years ago
Solved

Run TestComplete while compute is in Lock Mode

I feel funny asking this question but I can't figure it out.

 

I would run a long test case and my computer would lock up(work computer),  Is there a way I can keep it running while my computer is locked?  

 

How do you guys get around this?

 

 

Thanks

~D

3 Replies

  • bbi's avatar
    bbi
    Contributor

    In addition to how to and if you use script test, be aware of error that can occurs on user disconnected with VM.

    To manage theses errors you can use the general events onLogError to trap them.

     

    Something like that (look at bold text):

     

    /* ---------------------------------------------------------------------------
       Gestion des évènement log error
    --------------------------------------------------------------------------- */
    function GeneralEvents_OnLogError(Sender, LogParams) {
      if (LogParams.MessageText == LASTERRORLOG) {
        SAMEERRORCOUNT++;
        LogParams.Locked = true;
      }
      else {
        // Pour éviter un test rouge 
        // - sur une déconnexion de la VM 
        // - ou sur une VM non visible
        var skip = aqObject.CompareProperty(LogParams.MessageText, cmpContains, 'is invisible', false, lmNone); 
        if (!skip) { 
          skip = aqObject.CompareProperty(LogParams.MessageText, cmpContains, 'because the user session is disconnected', false, lmNone);    }  
        if (skip) { 
          Log.Message(LogParams.MessageText);
          LogParams.Locked = true;
        }      else {	  
          // Transformer les erreurs d'objet inexistants en warning
          if ((IGNORENOTFOUND) && ((aqObject.CompareProperty(LogParams.MessageText, cmpContains, 'Unable to find the object', false, lmNone)) || (aqObject.CompareProperty(LogParams.MessageText, cmpContains, 'The object does not exist.', false, lmNone)))) {
            Log.Message(LogParams.MessageText, LogParams.AdditionalText, pmHigher, qa.system.logWarning);
            LogParams.Locked = true;
          } 
          else {
            // Gérer les répétitions 		    
            if (SAMEERRORCOUNT > 1) {
              Log.Message('Erreur "' + LASTERRORLOG + '" répétée ' + SAMEERRORCOUNT.toString() + ' fois !', '', pmNormal, qa.system.logInfo);
            }  
          }
          
          LASTERRORLOG = LogParams.MessageText;
          Log.Message(LASTERRORLOG, LogParams.AdditionalText, pmHighest, qa.system.logError);
          SAMEERRORCOUNT = 0;
          LogParams.Locked = true;
        }
      }
    }
  • I had this problem at work as the result of a group policy that automatically locked all screens after 15 minutes of inactivity.  It wasn't a problem while a test was running, but if I wanted to leave a screen unlocked for a nightly scheduled test I couldn't do it.  I was able to request and get a specific exemption to this policy for my user account from our IT team.  Perhaps your IT team won't go for this, or you may have to provide some sort of assurance that the unlocked screen is still secure (e.g. in a locked room), but it's worth asking.

     

    FYI, I discovered a very useful trick related to this.  I have dedicated test machines that I access via remote desktop, but want to disconnect the remote desktop session and still leave them unlocked for TestComplete.  I discovered that if a monitor is connected to these machines, even if it doesn't have power (or even a power cord), you can still disconnect the remote desktop (using https://support.smartbear.com/viewarticle/86476/) and the machines will 'think' they have a local console and run the tests just fine.