Endpoint takes reference expression literally
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Endpoint takes reference expression literally
I am having an issue to run a REST GET, I need to sent a value as a header and I have a main service that generate the needed ID. In the header I add this reference ${#Project#ID} but the endpoint is literally taken "${#Project#ID}"
I already remove the ${#Project#ID} expression and put the ID generated "gbxsrtuiosnfj2$.483...etc" and it works fine.
I need to mandatory use the ${#Project#ID} or alternative way because this test is going to run automated.
I hope someone be able to help me with this problem.
Thank you.
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is very common use case. Something incorrect usage, I believe.
Screen shot of the request would help.
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just to be clarify.
You have a service that generates the header value required for your GET request which you are writing out to an ID property on your Project. Is that correct?
You have a subsequent GET request with a header value specifying the ${#Project#ID}. Is that correct?
So i'm expecting your testcase object hierarchy to be something like
ServiceRequest RESTstep which returns a value
GET RESTstep which has a header with value of ${#Project#ID}
Is that about right?
HOWEVER when you try executing the whole testcase containing the two teststeps the GET fails and you can see from the RAW of the GET request that the value ofthe header is the literal ${#Project#ID}, so doesnt appear to be parameterised.
The servicerequest step....it returns a header value.....is it returned in a response payload or is it included as one of the responses header values?
Ive used parameterisation in headers lots of times before now and it did work, so as Rao said....if you can provide some screenshots and just answer my questions to clarify, this will no doubt help everyone being able to diagnose whats going wrong and get you working, or at least provide workarounds for you.
Nice one,
Rich
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks richie, nmrao!
@scruzvx did you find a solution? Please share it with us
If you are still loking for help, please provide more details the Community is asking for and we will be happy to investigate this further here. Thanks.
Sonya Mihaljova
Community and Education Specialist
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I going to attach a couple of images.
If I put the ${#project#id} it doesn't work.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may also look at the documentation
https://support.smartbear.com/readyapi/docs/requests/rest/types.html
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you I will try with that info. I will let you know if it works
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Im just wondering about your progress?
Nice one
Rich
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@scruzvx :
1. Try to correct the spelling of ID,
2. Try to check that the Test Cases exist in same Project
3. Add a groovy step in same Test Case and use below code, if it works there it should work in header too
log.info ${#Project#ID}
it should show ID in logs.
Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓
Thanks and Regards,
Himanshu Tayal
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Community, thanks for the advice!
@scruzvx did you have a chance to try the new suggestions? Did it work?
Sonya Mihaljova
Community and Education Specialist
