Forum Discussion

AndiKoll's avatar
AndiKoll
Contributor
13 years ago

SoapUI sends same response twice

Hello,

I created the following test case:
    - Mock response
    - data source from an execl file: read filename into property fileName
    - mock response with script
    - data loop to mock response with script

The script used to manipulate the content of the response is this:
def project = mockResponse.mockOperation.mockService.project
def testSuite = project.getTestSuiteByName("Bulk tests")
def testCase = testSuite.getTestCaseByName("GetVrListFromMultipleFiles")
def testStep = testCase.getTestStepByName("GetDataFileNames")
def projectPath = project.getPropertyValue("projectPath")
def testDataPath = project.getPropertyValue("testDataPath")
def fileName = testStep.getPropertyValue("fileName")
log.info "reading file " + fileName
context.content = new File(projectPath + testDataPath + "\\" + fileName).text
log.info context.content

where the properties projectPath and testDataPath are properties set manually.
The fileName property is read also correctly and the file can be found. The log.info writes the content of the files correctly to the log file with the content expected.
The test case runs 5 iterations.

The test step used for the manipulated mock reponse has been inspired by the example of the chapter Mock operations and responses (http://www.soapui.org/Service-Mocking/s ... viour.html)

Nevertheless, the program under test - which sends the requests - records the same response content in each iteration
The program under test receives the same response in each iteration - which is definitely not intended.

3 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    I wonder how did you configure DataSource Loop step. It should be set that source be your DataSource test step and target should be
    mock response with script. If that is correct can send us a project file so we can reproduce, we can use mock service to verify this behavior.

    robert
    /Smartbear
  • Hello,

    I send the project file and additional data files per mail.

    Greetings
    Andi
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    Can you get nightly build and try? We made some changes.

    robert
    /Smartbear