Forum Discussion

Siji's avatar
Siji
Occasional Contributor
9 years ago

how to log the failure message s for individual test steps

While running a testsuites -test scase,how to log which test step is failing.

If its in a sequence,would like to register in which step it has failed.

Only the last execution's messages can be viewed.

2 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Siji,

     

    You can try doing the following:

    1. Add the TestRunListener.afterStep event to your project. Please read the following article for more information: http://readyapi.smartbear.com/readyapi/events/start
    2. Add the following script code to the Edit window:
    log.info(testStepResult.status);

    It will post statuses of execution of each your test step to the test log.

     

    Does this suggestion work for you?

    • Siji's avatar
      Siji
      Occasional Contributor

      Thanks for the reply.I am able to get the test status as OK or FAILED.

      I am running tests in a loop,where the data gets loaded from a datasource(here excel sheet)

      my test case has 5 steps,now i am able to log in the overall result as PASS or FAIL back to another excel sheet.

      ie testcase description and status.

      My issue is, I am not able to know,which test step has failed for that Test Case.

      ie when a test step fails along wd other details it shd also get added to my result

      Teststep description and corresponding error message.