Forum Discussion
As for your second post, I would use a Groovy script and use property expansion for ID_user and ID_number.
You can get the resource in the RequestFilter.FilterRequest event handler script with
String therequestUri = new String(context.getProperty("requestUri").toString())
and sorry, you need to use string manipulation methods to work with the URL and resource.
See
It might be a matter of just appending the property expansion to the URL/resource.
Then when that is done, use the context.setProperty("requestUri") for the new path based on the property expansion for the ID_user.
Of course the expansion is done by something similar to
def ID_user = context.expand('${#Project#ID_user}')
and then you can do something like therequestUri + ID_user and that should append the user ID. But this presumes you define the user at the project level. You might find it better to define the user ID at the test case level #testCase#ID_user.
I know that this answer is not the specific solution but a start on one approach. Maybe other people have alternatives that are easier. Your project properties ID_user and ID_number might be read off of a Excel spreadsheet. I have not done this.
Thank you Bill_In_Irvine,
This is a start, I will look into if your suggestions will work.
I was hoping it would be simpler way to just add to an URL but I might think in the wrong direction and just work it out through the testcase as per your suggestion.
It would be possible to just get a set of static values in an excel list to read from, but I was hoping to improve the test by getting fresh data.
- PaulMS8 years agoSuper Contributor
Template parameters are used to parametrize the request path.
https://support.smartbear.com/readyapi/docs/projects/requests/parameters/types/template.html
You can use a test suite or test case property as the input value for that parameter
- Crazy_Chris8 years agoOccasional Contributor
Hello PaulMS,
Thank you for the input.
I looked at this again but could not see a way to add data from a dynamic value received from a POST or GET request.
As mentioned I could create a static list from one of the format types(xml, cvs, json) and in each test, call the same values, but ideally I'd like to call a random value that is newly generated/created. And I cannot figure out how to pass these values to parametrize the request path. As I see it, these parameters need to be created and stored beforehand.
I will admit that I am quite new to Soap, so if I am mistaken if an example could be made I'd really appreciate the assistance.
Thanks!
--
Chris
- PaulMS8 years agoSuper Contributor
You can use groovy to generate a random number then set the value for a stored property.
Would this work?
Related Content
Recent Discussions
- 5 days ago
- 10 days ago