HELP - 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 is POST http://mec-stage-proc:9031/, but I am expecting GET 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.
Jennifer
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.Jennifer