cancel
Showing results for 
Search instead for 
Did you mean: 

How a request parameter that was programmatically set can be refreshed ?

Frequent Contributor

How a request parameter that was programmatically set can be refreshed ?

 Hello,

 

I'm currently trying to initialize testCases and steps programmatically.

So far, I manage to create the testCase and the testStep from the resource.

I can see from the following code that I have two parameters. I intend to set their value so they can be set dynamically through custom properties

def requestParameters = testStepConfig.config.restRequest.parameters.entryList // equivalent de testStepConfig.getConfig().getRestRequest().getParameters()

expand_prop = false // check if 'expand' property is available, in that case
requestParameters.each {
	e->
	log.info "${e.key} : ${e.value}"
}

I see :

Thu May 03 15:25:44 CEST 2018:INFO:expand :

Thu May 03 15:25:44 CEST 2018:INFO:exclude :

 

Then I build a string that I want to set as a value for a property :build_value = "\$"+"{" +"#TestCase#" + e.key + "}" which gives me:

Thu May 03 15:25:44 CEST 2018:INFO:build value : ${#TestCase#expand}

Thu May 03 15:25:44 CEST 2018:INFO:build value : ${#TestCase#exclude}

 

I do the following command for each parameter:

e.setValue(build_value)

 

If I go again through the loop above, I see :

Thu May 03 15:25:44 CEST 2018:INFO:expand : ${#TestCase#expand}

Thu May 03 15:25:44 CEST 2018:INFO:exclude : ${#TestCase#exclude}

 

Which is what I want, however, when I open my newly created request step, the parameter fields are empty. If I close and reopen ready API, it is the same ...

Does anyone has an idea of why I can't see the parameters value ?

 

thank you

 

Alex

 
 
 
 
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors