Forum Discussion
4 Replies
Sort By
- DefenderContributorNo answers... OK, I try to describe the problem more detailed:
I have my test case in testCase1 variable.
As I can see from Javadoc, the WsdlTestCase class containsaddTestStep(java.lang.String type, java.lang.String name)
method.
I have no detailed description in this Javadoc, but I suppose this method uses for adding a new test step for the testCase1.
The question on this stage is: what is the "type" parameter I need to pass into the method? I try to fill it with name of class which my step should correspond (it is the RestTestRequestStep) so my call looks liketestCase1.addTestStep("RestTestRequestStep", testStepName);
, but I receive null pointer exception here when I try to run my script. What am I doing wrong?
Another way to add the test step is to useaddTestStep(com.eviware.soapui.config.TestStepConfig stepConfig)
, but com.eviware.soapui.config.TestStepConfig is not described in Javadoc. Could you please describe how to use it?
The second thing is: when I use SoapUI to add the test step - I use the request as a source for it.
Taking a look on the RestTestRequestStep class I cannot see the direct possibility to configure the source request for the test step. The only thing I see issetRestMethod(RestMethod method)
, but this one configures the method instead of the request. The request may contain some setting differ from method settings & this confuses me. Could you please advice me in this?
The answer in Javascript is preferred. - DefenderContributorGuys, I need your answer ASAP. I cannot move forward without it.
- SmartBear_SuppoSmartBear Alumni (Retired)Hi,
sorry for the delay here.. if myRequest1 is a REST request you should be able to use
import com.eviware.soapui.impl.wsdl.teststeps.registry.RestRequestStepFactory
myTestCase1.addTestStep( RestRequestStepFactory.createConfig( myRequest1, "TestStep name" ))
Does that work better?
regards!
/Ole
SmartBear Sweden - DefenderContributorThanks, this works!
Related Content
- 2 years agomikefrank1
- 2 years agoDavid91