Kathryn_O_Malle
16 years agoContributor
SoapRequest / Mock Response pairs and scope rules...
Hi,
I've been working on a modular script setup in SoapUI 3.5 Pro which can handle multiple variations of message.
Basically the steps to generate each of the different messages, including the Soap Test Request to submit the actual message are always the same. The differences come with the Mock Responses and the assertions required to validate the return messages.
For instance -
// Generate and submit message
Test_Case_Generic_Generate_XML_Message
steps to generate message content
step to submit message
// One of mutliple scenarios...
Test_Case_Response_Scenario_One
Mock response step (unique bits for each scenario)
//Controlling test case
step to call Test_Case_Generic_Generate_XML_Message
Test_Case_Response_Scenario_One
[using control logic select mock response test case to call]
I have a controlling test case which calls the above two testcases. It runs fine until it hits the Mock Response step when I get a:
[tt:12qj93uq]ERROR [AbstractTestRunner] Exception during Test Execution java.lang.NullPointerException at com.eviware.soapui.impl.wsdl.teststeps.wsdlMockResponseTestStep.internalRun(wsdlMockResponseTestStep.java:393)...
[Set of additional lines not copied][/tt:12qj93uq]
My suspicision is that "scope rules" have caused the error, i.e. as the test case containing the submit message step has fully completed, when I come to try and create the mock response step it will fail as the reference to the submit message step has disappeared. Hopefully that makes sense as I'm not sure what has happened here...
Is there a way to do the modular scenario I describe at the start? Perhaps by creating the mock response text in a routine and store it in the actual mock response step by property expansion? But then is there a way to define the various assertions needed?
Hopefully the above makes sense...
Thanks
Adam
I've been working on a modular script setup in SoapUI 3.5 Pro which can handle multiple variations of message.
Basically the steps to generate each of the different messages, including the Soap Test Request to submit the actual message are always the same. The differences come with the Mock Responses and the assertions required to validate the return messages.
For instance -
// Generate and submit message
Test_Case_Generic_Generate_XML_Message
steps to generate message content
step to submit message
// One of mutliple scenarios...
Test_Case_Response_Scenario_One
Mock response step (unique bits for each scenario)
//Controlling test case
step to call Test_Case_Generic_Generate_XML_Message
Test_Case_Response_Scenario_One
[using control logic select mock response test case to call]
I have a controlling test case which calls the above two testcases. It runs fine until it hits the Mock Response step when I get a:
[tt:12qj93uq]ERROR [AbstractTestRunner] Exception during Test Execution java.lang.NullPointerException at com.eviware.soapui.impl.wsdl.teststeps.wsdlMockResponseTestStep.internalRun(wsdlMockResponseTestStep.java:393)...
[Set of additional lines not copied][/tt:12qj93uq]
My suspicision is that "scope rules" have caused the error, i.e. as the test case containing the submit message step has fully completed, when I come to try and create the mock response step it will fail as the reference to the submit message step has disappeared. Hopefully that makes sense as I'm not sure what has happened here...
Is there a way to do the modular scenario I describe at the start? Perhaps by creating the mock response text in a routine and store it in the actual mock response step by property expansion? But then is there a way to define the various assertions needed?
Hopefully the above makes sense...
Thanks
Adam