Forum Discussion

Prudential_UK_A's avatar
Prudential_UK_A
Frequent Contributor
15 years ago

[RESOLVED] Exporting results as CSV

Hi,
It is possible to export testsuite results as CSV file. How can I get a CSV file/s with all the testsuite results for a project? I need it to be at the level of testcase like the CSV file from the testsuite export.
Could I add an action to the project right-click menu to do this? How would I invoke the export to csv on each testsuite from a Groovy action extension script?
Regards
Peter

6 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    Check report button, instead generating jasper report or JUnit style report choose Data Export and for export format choose cvs, you could do this after you run TestSuite or TestCase.

    Let me know does it helps,
    robert
  • Prudential_UK_A's avatar
    Prudential_UK_A
    Frequent Contributor
    On the project>TestSuites tab ,the report button give Create Report dialog, but this does not have option for data export, only the ones o nthe testsuites and testcases have Data Export option
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    You have to run test suites first. So, click on run button and when they finish try report again, you should have Data Export now.

    Let me know does it work for you,
    robert
  • Prudential_UK_A's avatar
    Prudential_UK_A
    Frequent Contributor
    it does not give me the information I need.
    I need to have a row for each testcase with at least testcase name and run status(PASS or fail etc)
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    Hm...try this:


    import com.eviware.soapui.model.testsuite.TestStepResult.TestStepStatus

    for ( result in runner.results ) {
    def tc_name = result.getTestCase().getName()
    def status = "OK"
    for( stepResult in result.getResults() )
    if( stepResult.status != TestStepStatus.OK ) {
    status = "FAILED"
    break;
    }
    def time = result.timeTaken
    new File('/home/robert/ts_report.txt').append("$tc_name,$status,$time\n")
    }




    add this groovy script in teardown for test suite and change file name...


    Let me know, does this helps,
    robert