cancel
Showing results for 
Search instead for 
Did you mean: 

Reloading datasource values at runtime

Highlighted
New Contributor

Reloading datasource values at runtime

I have to test 2 API's in 1 test suite.I have to run a testcase and store the result using data sink and transfer the values to an excel sheet and in the same test case try to reload those excel sheet values it doesn't get the new values rather it gives the previous values. I need to pass the stored values in the test case due to which it fails. I have attached the flow wherein I have to pass values from Add Resource to saveResourceId. Then take values from ResourceIdData and pass it to Delete Resource test case.

 

Thanks in advance 🙂

 

 

5 REPLIES 5
Highlighted
Community Hero

Re: Reloading datasource values at runtime

Hi @asthay,

Why are you using a datasink to pass values onto subsequent steps?

Why not do the prop xfer to a Properties step? I don't use data sinks that often, but when ive used them before it tends to be as the final step in my test to save parm values. If im reusing parm values later on in a test, i either xfer the property values directly to the subsequent REST/SOAP steps or i save the parm values in a Properties step instead. Have you tried this approach?

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
New Contributor

Re: Reloading datasource values at runtime

Hi Richie,

 Thanks for your reply. I tried this approach also. But when I used groovy script to get those values it throws an error even though it loads all the values from property transfer and also when I tried to pass those values to DELETE API I wasn't able to load the values in that API. After that only I went with the approach to use data sink. 

Highlighted
Community Hero

Re: Reloading datasource values at runtime

Hey @asthay,

I wasnt suggesting using groovy (although its easy to do using groovy) as the native functionality (property expansion / prop transfer / Properties step handles) handles what you need to do without any problems.

If you tried with groovy and you publish the script i can have a look to see the problem?
Or replace your datasink step with Properties step as the datasink step is used to store data in files. I just double checked and the help makes no mention of using the properties created in a datasink step to reuse the properties, so im thinking yourr not using the datasink step im the way the help suggests.

Im typing this out on my phone so cant see your first post, but are you sure youre using a datasink mid test rather than a datasource step?

We arent really gonna be able to help much more without seeing your property transfers and requests and responses and logging.

Nice one

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
Community Hero

Re: Reloading datasource values at runtime

What is your use case ? If the runtime data needs to be used, then I guess writing them to file and reload can be avoided if more details available regarding the test flow.


Regards,
Rao.
Highlighted
Community Manager

Re: Reloading datasource values at runtime

Thank you for great suggestions Community!

 

@asthay have you tried the approaches mentioned? Please share you results🙂


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
New Here?
Join us and watch the welcome video:
Announcements
TechCorner Leaderboard
Want a fun and easy way to learn ReadyAPI and show off your skills? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Compare an expected JSON value and actual response in Events

Participate!

Fetch value/data from JSON response using Groovy Script

See replies!

Filtering data retrieved from a DataSource

See replies!

Get data from Petstore and add it to Excel sheets

Participate!
Top Kudoed Authors