Get TestCase Status in User Code

Ranorex Spy, Recorder, and Studio.
puniar
Posts: 5
Joined: Thu Jan 24, 2019 12:51 pm

Get TestCase Status in User Code

Post by puniar » Thu Mar 28, 2019 12:40 pm

Hi,

I have a User code module which calls for execution of a test case in another solution of the same project. Now I need to get the status of the execution (Passed/Failed) and update the status of the code module accordingly.

the code module looks something like this,

Process testProcess = Process.Start(testSuite,runConfig);
testProcess.WaitForExit();

Any help on proceeding further to this.

Regards,
Punith A

loonquawl
Posts: 64
Joined: Wed Nov 22, 2017 10:08 am

Re: Get TestCase Status in User Code

Post by loonquawl » Thu Mar 28, 2019 1:36 pm

You could use

result = testProcess.ExitCode

after the code you posted; Then do whatever with 'result' (0 for success, -1 for Fail, 42 for lack of license)

puniar
Posts: 5
Joined: Thu Jan 24, 2019 12:51 pm

Re: Get TestCase Status in User Code

Post by puniar » Wed Apr 17, 2019 11:36 am

thanks @loonquawl, it worked.

Can the solution which i had posted achieved in a different approach than using the Process method? I am seeking some more options to get it worked.