cancel
Showing results for 
Search instead for 
Did you mean: 

Groovy Scripting- TestRunner Property

SOLVED
Highlighted
Occasional Contributor

Groovy Scripting- TestRunner Property

I am reading column value from data source(.csv) and using string split function to capture a sub string value.

This substring value is  stored in a property using :

testRunner.testCase.setPropertyValue("card_number", cardNum)

and then is passed to the request using ${#TestCase#card_number}

 

It works fine when there is only 1 loop in the test case. However in mine there are multiple test rows being run in loop and the property value is not getting reset  instead value read first time from the property is being passed on to requests in subsequent loops.

I tried testRunner.testCase.setPropertyValue("card_number",null ) as well as testRunner.testCase.setPropertyValue("card_number","" ) but no luck..Need help from experts.

 

 

@richie @ChrisA  @PrathapR 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Manager

Re: Groovy Scripting- TestRunner Property

Hi @sumit0609 ! Were you able to solve this issue? If not, please provide more info the Community is requiring and the community members will do their best to help!

 

Otherwise, you can raise a support ticket with our Customer Care team by this link


Sonya Mihaljova
Community and Education Specialist

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

View solution in original post

5 REPLIES 5
Highlighted
Contributor

Re: Groovy Scripting- TestRunner Property

@sumit0609 

 

are there any other columns except "cardNum" in your sheet?, if yes, are they updating when loop iterates to next record?

 

Highlighted
Occasional Contributor

Re: Groovy Scripting- TestRunner Property

@PrathapR  There are several columns in the datasource. Somehow what ever i do the value is nt getting reset to empty instead value fetched first time is always being fed to susbsequent request.

Highlighted
Community Hero

Re: Groovy Scripting- TestRunner Property

Hey @sumit0609,

Can you provide a screenshot of the testcase so we can see the test step items in your test object hierarchy please?
Also, can you provide the groovy (and script assertions if used), so we have a better idea of whats going on with the flow?

Cheers,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Contributor

Re: Groovy Scripting- TestRunner Property

Just to echo @richie 's comment.  Screenshots would be useful so we can see the steps and where the loop is within your test.

Highlighted
Community Manager

Re: Groovy Scripting- TestRunner Property

Hi @sumit0609 ! Were you able to solve this issue? If not, please provide more info the Community is requiring and the community members will do their best to help!

 

Otherwise, you can raise a support ticket with our Customer Care team by this link


Sonya Mihaljova
Community and Education Specialist

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

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors