Forum Discussion

TNeuschwanger's avatar
TNeuschwanger
Champion Level 1
3 years ago

Command Line Run with output files that contain "Messages" that I would like to control

Hello, I am running lots of tests through the ReadyAPI/SoapUI command line.  There is parameter to generate reports (not really important just background for the question)...  CALL "C:\Program F...
  • TNeuschwanger's avatar
    TNeuschwanger
    3 years ago

    Hello KarelHusa 

     

    Thank you for the direction.  After more research, it looks like the key to that message section is in the "Events" manager portion of ReadyAPI.  If I add a new event handler for "TestRunListener.afterStep", I can put whatever I need to in the messages area of the report.

     

    Here is just the smallest code snippet to add to that event...

    import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep
    import com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep
    import com.eviware.soapui.impl.wsdl.teststeps.HttpTestRequestStep
    import static com.eviware.soapui.model.testsuite.TestStepResult.TestStepStatus.*
    
    def testStep = testStepResult.getTestStep();
    testStepResult.addMessage("  ---   TESTING");    
    testStepResult.addMessage(" --  ${testStep.name}");
    

    When run from testrunner.bat, I see the following below for one of my test steps (this code does not differentiate well however, I will adjust it so the message only occurs when I want it to and not for every test step).

    Status: PASS
    Time Taken: 25
    Size: 0
    Timestamp: Tue Oct 04 19:29:24 PDT 2022
    TestStep: Populate Properties For Testcase
    
    ----------------- Messages ------------------------------
      ---   TESTING
     --  Populate Properties For Testcase
    

     

    Regards,

    Todd