Ask a Question

TestComplete cannot find process

SOLVED
andreeailiuta
New Contributor

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.

The application has a windows service and when trying to access it in TestComplete (Sys["Process"]("WebService.Service")["Exists"]) the test fails ("The process "WebService.Service" was not found"), although the process is displayed in task manager.

Also, when looking into Object browser, the process is not displayed there.

The "Show all processes" option is already selected and so is the "Show all process" checkbox in Process filter dialog, yet the process is not displayed in this section.

We got stuck since, at some point, Sys["Process"]("WebService.Service")["Exists"]) worked as expected.

 

Can you tell what we are missing or give us more information in order to determine why this process cannot be identified?

 

Thanks in advance!

2 REPLIES 2
tristaanogre
Esteemed Contributor

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-metho...


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
andreeailiuta
New Contributor

Hello,

 

I followed your example and the result was kind of surprising:

When running the rest on TestComplete, the process is still not found, but when launching it (the same test and the same code) on TestExecute, the process is found and the test passed. 

 

Thank you for your feedback!

 

cancel
Showing results for 
Search instead for 
Did you mean: