Contributions
Re: How to use groovy script to dynamically store data in data source grid?
Thanks againChrisAdams. For the newbies - you can set the data source and target step by double clicking on the Data Source loop and you will see the following prompt: It's Lunar New Year eve tonight. Over and out (for now). Jennifer3 years agoPlace ReadyAPI QuestionsReadyAPI Questions303Views1like0CommentsRe: How to use groovy script to dynamically store data in data source grid?
That againChrisAdams. Going by you screenshot - it is possible to have more than just api step inside loop. I’ll need to play around in ReadyAPI to find out how. When I do - I’ll post it on this thread - hopefully I can other newbies. Many thanksChrisAdams. Jennifer #StaySafe3 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.5KViews0likes2CommentsRe: How to use groovy script to dynamically store data in data source grid?
Hi ChrisAdams, Thanks for your help Chris. I've re-arrange the steps and know the syntax on how to get data. Also is it possible to call the groovy script each time the api is called? At the moment - the groovy script is just called once (at the start) and then it loops the api step only. What I"m trying to do is get a different time stamp - each time the api is called. Let me know if I should raise another ticket question for this. Jennifer3 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.5KViews0likes4CommentsRe: How to use groovy script to dynamically store data in data source grid?
ThanksChrisAdams. Based on what you said - it looks like I'm on the right track. This is what I have atm. This is what my data source grid looks like: My original question was: "how to do STORE values in the groovy step into data source grid?" Is this possible? If so - then I will add another property in the data source grid called currentDate. Then I hope to loop the groovy script to get and store date and the api step will 'get data' from the respective property from the datasource grid. Alternatively if I cannot store in data source grid - then I will store in test case properties. It's Australia Day today.🇦🇺 #StaySafe. Jennifer3 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.5KViews1like6CommentsHow to use groovy script to dynamically store data in data source grid?
Hi, I want to use a groovy script to store data+time stamp value into data source grid. I think the steps are: 1) create data source grid step stores the data 2) create groovy step this script to get and then store the date value into data source grid 3) create api step this is actual call to api 4) data source loop this loops through each record in the data source as it calls the api Is that correct? In my groovy step, to get date I have: def today = new Date() def formattedDate = today.format("ddMMyyhhmm") log.info(formattedDate) But I'm not sure what the syntax is to store the value in data source. Can someone help me? JenniferSolved3KViews0likes10CommentsRe: HELP - Trouble passing values from one API to next API
Thanks for your time and tips richie. Re:I noticed that in your GetCustomer test case you used the PRopertyTransfer object, whereas it appears for the PauseContract test case it looks like you're using the GetData functionality and pulling the values directly from the Properties step. Yes I was trying different techniques (ie using GetData and PropertyTransfer) to pass the value to see what would work. Both didn't seem to pick up the value. Though the PropertyTransfer did store the value correctly. The solution seems to be NOT to use special characters (ie curly brackets - {} in this case) as trips over when it's replaced. So when I renamed the test case (ie removed {}) - I am about to use GetData functionality to retrieve the value. So the value in id of Pause Contract is ${#[MEC-ShakedownForDisplay#GetCustomer#GET Request]#Response#$['data']['contracts'][0]['contractId']} (note there is no curly brackets in label for GetCustomer). I should have known better - this is standard things to avoid in any language. Though note the labels of the test suite and test cases and test steps were created by default when I imported the Swagger definition. Jennifer3 years agoPlace ReadyAPI QuestionsReadyAPI Questions598Views1like0CommentsHELP - Trouble passing values from one API to next API
I am having trouble passing values between from one API to next API for some routes. And I'm not sure why. I have CreateCustomer route and then in GetCustomer route I get the id from the CreateCustomer route (1). I used the GetData functionality to retrieve the value ${#[MEC-Shakedown#/api/v1/customer: CreateCustomer#POST Request]#Response#$['data']['id']} That works ok, I can see the id in the raw format (ie GET http://mec-stage-proc:9031/api/v1/customer/57863(2)) And I was returned a response (3), see screenshot directly below: But when I try the same thing for my PauseContract API - first I cannot see the expected value (1) in raw format and then I don't get a response (2). So in PauseContract API, I obtain the contractId from the response from GetContractAPI ${#[MEC-Shakedown#/api/v1/customer/{id}: GetCustomer#GET Request]#Response#$['data']['contracts'][0]['contractId']} The raw format isPOST http://mec-stage-proc:9031/, but I am expectingGET http://mec-stage-proc:9031/api/v1/contract/55/pause, as a result I am not receiving a response. See screenshot immediately below: What am I doing wrong? I also tried to store the contractId after GetCustomer - and using GetData refer to that property instead. ${#[MEC-Shakedown#/api/v1/customer/{id}: GetCustomer#Properties 2]#contractId} When I hard code the value, I am returned the appropriate response. Yes a newbie to ReadyAPI. JenniferSolved648Views0likes2Comments