Groovy Scripting- TestRunner Property
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
are there any other columns except "cardNum" in your sheet?, if yes, are they updating when loop iterates to next record?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just to echo @richie 's comment. Screenshots would be useful so we can see the steps and where the loop is within your test.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
