Parameterize a Request URL as text for API Testing
I'm new to API testing and We're having some issues trying to put parameters in a request URL, we've set some headers in the API call like the content-type which is url encoded, so in the request body we have something like this:
When we make the post request we get an .xml as response and we're trying to pass some of the values as inputs for the next calls that are very similar to the first request.So, what we want to do is pass the response data as inputs for the former request.
The XML is like this:
<setenv name="login" value="XXXXX" />
<setenv name="admin" value="XXXXX " />
<setenv name="id_pos" value="xxxx" />
<setenv name="serial" value="xxx-xxx-xxx " /
Now, we can make it with visual tests and even other requests that accept xml as input, but we're struggling with this scenario where the xml responses are the inputs for the next requests. So the question is: It can be done? or should I define some test data in the data pane and try to pass it in the request body. If that approach is better, what is the best way to do it?
Any advice would be apreciated.
Hi, thanks for your response, we're trying to build a request body but we're unable to formulate it in the grid view so we're doing it in the "old fashioned way" which is concatenate strings, so far is going good but we have to do a lot of concatenation, so I was wondering if we can use a custom expression like this one:
In this expression we set the request and we're trying to take the values from the response XML but we're not sure if this is going to work.
Thanks for your advice!