Werner_Blueml
15 years agoOccasional Contributor
Problem with two MockResponse Steps in one TestCase
Hi All,
Is it possible to have 2 MockResponse Steps in one Testcase running on same path and port ?
MyTestCase
URL for Request's:
Request 1 : "http://127.0.0.1:9080/userService"
Request 2 : "http://127.0.0.1:9080/userService"
Path and Port for MockResponseSteps:
Mock getUserByKey --> Path "/userService", Port "9080"
Mock getUserById --> Path "/userService", Port "9080"
With this configuration the Testcase didn't work. The request didn't arrive at the MockResponse Step and the following response is send.
Response for Request 2:
When I change the Ports for 2nd Request to 9090 it works!
URL for Request's:
Request 1 : "http://127.0.0.1:9080/userService"
Request 2 : "http://127.0.0.1:9090/userService"
Path and Port for MockResponseSteps:
Mock getUserByKey --> Path "/userService", Port "9080"
Mock getUserById --> Path "/userService", Port "9090"
What can I do to use the same port?
Regards Werner
Is it possible to have 2 MockResponse Steps in one Testcase running on same path and port ?
MyTestCase
Test Steps (6)
TestData Testdata for the Testcase
getUserByKey Request 1
getUserById Request 2
Loop Data Process next DataRow (getUserByKey)
Mock getUserByKey Response for getUserByKey, StartStep = getUserByKey
Mock getUserById Response for getUserById, StartStep = getUserById
URL for Request's:
Request 1 : "http://127.0.0.1:9080/userService"
Request 2 : "http://127.0.0.1:9080/userService"
Path and Port for MockResponseSteps:
Mock getUserByKey --> Path "/userService", Port "9080"
Mock getUserById --> Path "/userService", Port "9080"
With this configuration the Testcase didn't work. The request didn't arrive at the MockResponse Step and the following response is send.
Response for Request 2:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>Server</faultcode>
<faultstring xml:lang="?">org.apache.xmlbeans.XmlException: error: Unexpected end of file after null</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
When I change the Ports for 2nd Request to 9090 it works!
URL for Request's:
Request 1 : "http://127.0.0.1:9080/userService"
Request 2 : "http://127.0.0.1:9090/userService"
Path and Port for MockResponseSteps:
Mock getUserByKey --> Path "/userService", Port "9080"
Mock getUserById --> Path "/userService", Port "9090"
What can I do to use the same port?
Regards Werner