Forum Discussion

mkositsin's avatar
14 years ago

AUT is not recognized as Open Application if TestComplete is started remotely

Ok, I have a pretty complicated setup here. Hope I will be able to explain my problem.



First, I wrote a connected application which launches TestComplete and performs different actions in UI of another application (AUT). AUT is written in C# and uses DevExpress controls, it is recognized as "open" by TestComplete so there is no problem here.



Second, I'd like to integrate my testing app into continuous integration development cycle. I got one machine with TeamCity server+agent and another with agent only. I wrote Ant build script which basically has only one command -



<exec executable="C:\Dev\Test\BuildScripts\psexec.exe" dir="C:\Dev\Test\BuildScripts">

  <arg line="-u user -p pass -i 0 nunit-console.exe /xml:"C:\testresult.xml" "C:\Dev\AutoTest\TC_ConnectedApplication\bin\Debug\TC_ConnectedApplication.exe"" />

</exec>



which launches psexec.exe, which in turn launches nunit-console.exe with users credentials, and nunit-console.exe in turn launches my testing app ("TC_ConnectedApplication.exe"), and the test app launches TestComplete and performs tests in AUT. TeamCity agent runs under system account (I tried to run under user account with same results), that is why psexec is used to run tests under user account with UI session. TeamCity project is configured to checkout build script from svn to local folder on agent. When I run TeamCity project using agent which is installed on the same machine as server everything works just fine without a problem.



Next, I'd like to launch my test TeamCity project using agent on another machine. I log in to this second machine using same user/pass as to the first one (actually both machines are virtual and the second is clone of the first), then launch AUT manually. After that I start TeamCity test project on the first machine. After that I see on the second machine that nunit-console.exe is started, then TestComplete is started but it does nothing in AUT and posts error messages in log something like "Object is not found". When I check TestComplete Object Browser, it shows that AUT is not recognized as "open" and all objects use other names.



On the other side, if I launch AUT programmatically from my testing app (so both TestComplete and AUT are launched by testing app) everything works without problem again.



So, actually there is a problem only when TeamCity project is run using agent not on the same machine as server, and AUT is launched manually on agent machine before running test. In that case AUT is not recognized as "open".



Any idea why?



And by the way, I am using TestComplete 7.50.



Thank you

1 Reply

  • Hi,



    When you launch applications remotely or from a service, they can have restricted permissions and be unable to access processes launched in the system. TC just doesn't have enough permissions in your case, or it is launched in a different user session than the one in which your application is launched. So, the only reliable way to run your test in this case is to launch your tested application from TC (or launch them both from your testing app).