Forum Discussion

LazareGiuna's avatar
LazareGiuna
New Contributor
7 years ago
Solved

How to see actual history of test cases?

Hello, I know that it's possible to see the History of the test case in navbar and see when it failed or succeed. But Is it possible to see the actual results of the test cases?  For example,I hav...
  • richie's avatar
    richie
    7 years ago

    Hi,

     

    this might provide what you need - although it's not within the soapui GUI.

     

    Within the soap.org Tips&Tricks section 8.1 it includes a page that describes a custom event handler groovyscript that records all inputs/outputs/requests/responses for every step within a test case within a test suite within the project.

     

     

    I can't find the page at the moment - but it records everything (except the individual assertion detail - although it does indicate if the step passes or fails) - but other than that - it records everything - this is what I use to capture my test evidence.

     

     

    Highlight your project within ReadyAPI!, then click on the 'Events' button.

    Click on the plus symbol and scroll down to 'TestRunListener.afterStep'

     

    Then add the following script

     

     

    def pName = context.currentStep.testCase.testSuite.project.name //get project name
    def pDate = new Date().format( 'yyyyMMdd' )//get current date
    def sDate = pDate.toString()//convert date to string
    def pTestSuite = context.currentStep.testCase.testSuite.name//get TestSuite name
    def pTestCase = context.currentStep.testCase.name//get TestCase name
    def filePath = 'D:/TestEvidence/SOAPUI LOGGING SCRIPT/soapUI-results/'+pName+'_'+sDate+'/'+pTestSuite+'/'+pTestCase+'/'//compose the folder path
    
    File file = new File(filePath)
    if (!file.exists()) file.mkdirs()//create the destination folder
    
    fos = new FileOutputStream(filePath+ testStepResult.testStep.label + '.txt', true)
    pw = new PrintWriter( fos )
    testStepResult.writeTo( pw )
    pw.close()
    fos.close()

     

     

    Every time a test case is executed, a new directory is created with the datestamp.

     

    Obviously this won't help you find stuff before today - but it will record all the raw input/output going forward.

     

    I know this isn't exactly what you are asking for, but it might give you enough of what you need,

     

    cheers,

     

    richie