Ask a Question

Changing test step names using Groovy

lc25s
Occasional Contributor

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 4
lc25s
Occasional Contributor

Re: Changing test step names using Groovy

just needed to walk away ...

ts.getName()
ts.setName(<String>)

[Resolved] Re: Changing test step names using Groovy

Great to hear it works. Thanks for sharing the resolution!

Thanks,
Michael Giller
SmartBear Software


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
sameer004
New Contributor

Re: [Resolved] Re: Changing test step names using Groovy

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
Contributor

Re: [Resolved] Re: Changing test step names using Groovy

or 

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

 

cancel
Showing results for 
Search instead for 
Did you mean: