Forum Discussion

liche's avatar
liche
Occasional Contributor
12 years ago

[Resolved] Change request content dynamically

Hi all,

Actually, I have 2 test step :
1. GroovyTestStep
2. RequestTestStep

In my groovy TestStep, I run several times the RequestTestStep, and I wan to set the request content of the RequestTestStep :
context.content = "TheMessage"
testRunner.runTestStepByName("RequestTestStep")


In my RequestTestStep, I have currently in the request (the left side):
${GroovyTestStep#content}

It's not working. Did you have any idea about the variable to use (a lot of testStep properties are on readonly) and a global testsuite property is not enought since the message I want to transmit can be really big.

(I already thought about a solution with several groovy test steps and by looping but it's really not properly done.)

Thanks a lot for your help

2 Replies

  • PaulDonny's avatar
    PaulDonny
    Regular Contributor
    tests = testRunner.testCase.getTestStepByName("Test");
    tests.properties["Request"].value = 'this is an example';

    This will input the data directly into the request as a whole.
  • liche's avatar
    liche
    Occasional Contributor
    Thanks a lot PaulM.
    I forget the (.value).