Forum Discussion

678's avatar
678
Regular Contributor
7 years ago

Each Datasource row as a Testcase Name

I would like to get reports as Each Datasource Row as a Test case name 

 

Here is my farmework 

 

Datasource has Row 1 = Testcase1, Row 2 = Testcase2 

 

Test Suite - Test case (Request1) = when i run Test case from ReadyApi (Request1) than i need to get the reports as Testcase1, Testcase2 

 

Datasource Loop 

2 Replies

  • // in a groovy step after your DataSource step pull the name of the column that contains the test case name you are wanting to update

     

    def TestCaseName = context.expand( '${DataSource#TestCaseName}' )

     

    //if you are wanting to change the name of the Test Case at runtime
    context.testCase.setName(TestCaseName)

     

    //if you are wanting to change the name of the request step name at runtime
    tc = testRunner.testCase.getTestStepAt(2) // The number 2 would represent the position of the step in your test case. Starting with 0 as the first step


    tc.setName(TestCaseName)

    • 678's avatar
      678
      Regular Contributor

      bagochips

       

      I did as per your suggestion, i can able to change Test Case name and Runtime and Test Step name on run time but on the reports i am not getting  Each Row as a test case name