Ask a Question

Operating with TestCase properties - Groovy

Frequent Contributor

Operating with TestCase properties - Groovy

  • Operating with TestCase properties

Create a script which updates values of the selected options in all TestCases within the current TestSuite. All the options from the Basic tab should be available for modification ( - it's up to the script user which ones to comment/uncomment before running the script.



Below scripts to update properties of test case in basic option. I post all of them as screenshot attached( Maybe can better construct following scripts rather than writting similar method. FYI


def searchProperties = {testcase, boolean flag -> testcase.setSearchProperties(flag)}
def httpSession = {testcase, boolean flag -> testcase.setKeepSession(flag)}
def abortFailOnError = {testcase, boolean flag -> testcase.setFailOnError(flag)}
def failTestCaseOnErrors = {testcase, boolean flag -> testcase.setFailTestCaseOnErrors(flag)}
def testCaseTimeout = {testcase, long num -> testcase.setTimeout(num)}
def discardResult = {testcase, boolean flag -> testcase.setDiscardOkResults(flag)}
def maxResults = {testcase, int num -> testcase.setMaxResults(num)}

testSuite.getTestCaseList().each{testcase ->, true), true), false) // note its status, true) // note its status, 10000), true), 10)
Community Manager

Re: Operating with TestCase properties - Groovy

Great example, aaronpliu!

Thansk for preparing it for the Community.

Tanya Yatskovskaya
SmartBear Community and Education Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Showing results for 
Search instead for 
Did you mean: