14 years ago
TEMPLATE Parameter replacement
I will start off saying, I am still pretty new to SOAPUI. I have a situation that I hope I can explain well enough that someone will be able to help because I am sure it is simple to do, just not sure how to do it currently. I imported a WADL definition into my project in which one of the REST calls contains a TEMPLATE parameter. In a test case I have a Groovy Script that sets up some values for test steps that follow which are rest requests. I can get headers set, the username and password set for authentication, but am having trouble getting the TEMPLATE parameter to be replaced. When I run the test case it doesn't seem to be replacing the value in the rest request test step, it just uses the TEMPLATE. Thanks for any help!
Here is how I am currently setting the headers/username/password....would like to figure out how to get the TEMPLATE parameter value in same block, just can't figure out how to set this value:
testRunner.testCase.testSteps.each
{
if (it.getValue().config.type.equals("restrequest"))
{
it.getValue().getHttpRequest().setRequestHeaders(headers);
it.getValue().getHttpRequest().setEndpoint(endpoint);
it.getValue().getHttpRequest().setUsername(userName);
it.getValue().getHttpRequest().setPassword(Pwd);
}
}
Here is how I am currently setting the headers/username/password....would like to figure out how to get the TEMPLATE parameter value in same block, just can't figure out how to set this value:
testRunner.testCase.testSteps.each
{
if (it.getValue().config.type.equals("restrequest"))
{
it.getValue().getHttpRequest().setRequestHeaders(headers);
it.getValue().getHttpRequest().setEndpoint(endpoint);
it.getValue().getHttpRequest().setUsername(userName);
it.getValue().getHttpRequest().setPassword(Pwd);
}
}