Forum Discussion

andreeailiuta's avatar
andreeailiuta
New Contributor
7 years ago

TestComplete cannot find process

Hello,   We automate test cases for a desktop application in TestComplete V12.42 and all test are run on a test machine, using TestExecute V12.42 where is configured Team Foundation Build Service. ...
  • tristaanogre's avatar
    7 years ago

    This is, most likely, a timing issue in that the process is not present when the "Exists" property is checked.  If you think about it, you can't call the "Exists" property of an object if there is no object.  You can't check ANY property of an object that does not exist.

     

    If you're looking at testing the process existance, this is the better code to use (JavaScript):

     

    var processExists;
    var webServiceProcess;
    
    processExists = Sys.WaitProcess('WebService.Service', 20000).Exists
    if (processExists){
        webServiceProcess = Sys.Process('WebService.Service');
    }
    else{
        Log.Error('The WebService.Service process did not resolve within 20 seconds');
    }

    See https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/sys/waitprocess-method-sys-object.html