AndiKoll
14 years agoContributor
SoapUI sends same response twice
Hello,
I created the following test case:
The script used to manipulate the content of the response is this:
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.
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.