Forum Discussion

lc25s's avatar
lc25s
Occasional Contributor
11 years ago

Changing test step names using Groovy

Is it possible to change test step names using groovy? The set/get property methods seem to set/grab from custom properties, but I want to access

GroovyScript Properties
MockResponse Properties
TestRequest Properties

4 Replies

  • lc25s's avatar
    lc25s
    Occasional Contributor
    just needed to walk away ...

    ts.getName()
    ts.setName(<String>)
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Great to hear it works. Thanks for sharing the resolution!

    Thanks,
    Michael Giller
    SmartBear Software
    • sameer004's avatar
      sameer004
      New Contributor

      import groovy.io.FileType

       

      ///getTestStepAt(3) means the testcase is at the 4th index in testsuite, it starts like an error

       

      context.testCase.getTestStepAt(3).setName("MY new testcase Name")

       

       

      Hope it helps

      • tech321's avatar
        tech321
        Contributor

        or 

        context.testCase.getTestStepByName("MY old testcase Name").setName("MY new testcase Name")