cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the test case execution status(pass/fail) after the test run?

SOLVED
SJ1
Occasional Contributor

How to get the test case execution status(pass/fail) after the test run?

Hi, A newbie question - I have a set of tests which are being executed in TestComplete 12.5.

 

1. How do we add assertion for the test case's expected result? 

 

2. Also, can you assist me with the script to get test execution status (such as pass or fail) at the end of every test run as I am planning to write the status against each test case in excel?

 

Thanks.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Hero

Re: How to get the test case execution status(pass/fail) after the test run?

For your assertions, take a look at Property Checkpoints:

https://support.smartbear.com/testcomplete/docs/testing-with/checkpoints/property/about.html

 

Here's some information about exporting log results.  See if this works for what you want.  If not, give us some more specific details about what you are trying to do and we can help further.

https://support.smartbear.com/testcomplete/docs/testing-with/log/working-with/exporting/about.html

View solution in original post

Community Hero

Re: How to get the test case execution status(pass/fail) after the test run?

I use this in an on test stop event handler:

 

function GetTestStatus() {
  Let result = "CHECK";
  try {
    if(Log.ErrCount == 0) {
      result = "PASSED";
    } else {
      result = "FAILED";
    }
  } catch(err) {
    Log.Warning(err);
  } finally {
    return result;
  }
}

 It returns the number of errors in the currently running test item.


Thanks,
Carson

Click the Accept as Solution button if my answer has helped

View solution in original post

3 REPLIES 3
Community Hero

Re: How to get the test case execution status(pass/fail) after the test run?

For your assertions, take a look at Property Checkpoints:

https://support.smartbear.com/testcomplete/docs/testing-with/checkpoints/property/about.html

 

Here's some information about exporting log results.  See if this works for what you want.  If not, give us some more specific details about what you are trying to do and we can help further.

https://support.smartbear.com/testcomplete/docs/testing-with/log/working-with/exporting/about.html

View solution in original post

Community Hero

Re: How to get the test case execution status(pass/fail) after the test run?

I use this in an on test stop event handler:

 

function GetTestStatus() {
  Let result = "CHECK";
  try {
    if(Log.ErrCount == 0) {
      result = "PASSED";
    } else {
      result = "FAILED";
    }
  } catch(err) {
    Log.Warning(err);
  } finally {
    return result;
  }
}

 It returns the number of errors in the currently running test item.


Thanks,
Carson

Click the Accept as Solution button if my answer has helped

View solution in original post

SJ1
Occasional Contributor

Re: How to get the test case execution status(pass/fail) after the test run?

Thanks @Marsha_R and @cunderw.

I have used property checkpoints for assertions and used the above code to know the test status case status based on log messages.