Forum Discussion

Gordon_McNair's avatar
Gordon_McNair
Contributor
15 years ago

Trying to change testStep Encoding porperty

One of our test analysts is trying to change the Encoding property in a testStep so he can loop through the same request with a number of different encodings.

In his attempts he has been unable to set the property.

He wrote some code to dump properties and the Encoding property did not show up in the list.

The code is:

def encoding = context.expand( '${DataSource#encoding}' )

def tempStep = testRunner.testCase.getTestStepByName("Create Form Session - REST");

tempStep.properties.each(){elemProperty ->
log.info(elemProperty.key)
if(elemProperty.key == 'Request'){
log.info(elemProperty.value)
}
}


There are a number of properties listed by the logging command but Encoding is not one of them.

Is there a way to access this property at runtime to support this approach?

Thanks,
Gordon.
  • Hi,

    the encoding property is part of the request ie you can access it by :

    testStep.testRequest.encoding = "..."

    hope this helps
    regards
    nebojsa
  • Thanks for the information. I'll get the team to try it out today.

    Thanks again,
    Gordon.