Forum Discussion

Nspyre_BV_Suppo's avatar
Nspyre_BV_Suppo
New Contributor
14 years ago

Rename Report: Current Row -> Current testcase

Best Employee,

1. We are using Excel as datasource, when selecting 10 rows the testsuite(program) will start (somehow) with the latest row (Testcase M300301-T010, and not with T001, someone know why this happen?)
This row T010 will be called it in the report as Current Row = 1. To make it as a official reference between Excel testcase and the “Current Row” we like to make a change in the report.

As. Example the testdata:



It would be nice if we could adapt the report from current Row to “Current Testcase” ${DataSource#TestCase-Nr}
We will get the number “M300301-T010” out the datasource, ${DataSource#TestCase-Nr}
Can you tell us if this is possible? Perhaps someone can hand over an example?
Manny thanks in advance.

Best Regards / Met vriendelijke groeten,
Huib
  • Hi Huib,

    try adding a separate Groovy Script Step inside your loop that returns the desired output, ie its content could be just

    return context.expand( "${DataSource#TestCase-Nr}" )

    This returned text should be visible both in the TestCase log and the generated report..

    Does this help?

    regards,

    /Ole
    SmartBear Sweden
  • Hi Ole,

    Thank you for the reply, i tried your Groovy Script code but gave the error:

    "org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script19.groovy: 1: unexpected char: '#' @ line 1, column 36. return context.expand("${DataSource#TestCase-Nr}") ^ org.codehaus.groovy.syntax.SyntaxException: unexpected char: '#' @ line 1, column 36. at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:134) at ... "

    I have changed your quotes >"< to single quotes >'< and that helped me, when running the script i got the latest testcase Nr "M300301-T010". But... the row nr did nog change on the report, see the screenshot (With and without your solution):



    I see that step 2 appears in the report, but the whole list of all transfers is to much of it Can this be limited to just the testcase-Nr.
    The report shows every transfer in it, but the main target is to replace the text "Current Row = 1" to "Current testcase = M300301-T010" so we can validate the outcome with our testcases. My question, do you know the code for change this "Current Row" item on the report?

    Somthing: return report.Current.Row-NR = context.expand( '${DataSource#TestCase-Nr}' )???

    Manny thanks in advance


    p.s. I am not familiar with Groovy script, perhaps you have a link to a guide for me?
  • Additional:

    As a matter of fact: the steps in the report represents the teststeps(some system variables).
    - Current Row (Datasource Loop)
    - Script result (groovy script)

    Main question, can we change the default systemvariables / text?
  • Hi,

    sorry for the slow response here; unfortunately it isn't possible to change these default texts - the only way to output custom texts in a report is by either creating a totally custom report (see http://soapui.org/Reporting/customizing.html), using the built-in scripting possibilities (see http://soapui.org/Reporting/scripting-extensions.html) or as already shown with the Script TestStep.

    Please add feature requests for the improvements you would like to see so we can prioritize them accordingly.

    regards!

    /Ole
    SmartBear Stockholm