Jahush
11 years agoOccasional Contributor
SoapUI API: Create DataSourceStep
Hello,
i am building an java application using the SoapUI Pro API. My application shall allow the user to create a full SoapUI project (testsuites, testcases, teststeps and so on).
But I am encountering a problem creating the datasource test step.
I tried a few things which did not work :
Test 1:
WsdlDataSourceTestStep testStep = (WsdlDataSourceTestStep) testCase.addTestStep(DataSourceStepFactory.DATASOURCE_TYPE,testStepName);
testStep.setDescription(ExcelDataSource.TYPE);
// This sends a NullPointerException due to testStep being null.
Test 2:
WsdlTestStep testStep = testCase.addTestStep(DataSourceStepFactory.DATASOURCE_TYPE, testStepName);
// Without parsing the object is not null, but what I need is a WsdlDataSourceTestStep and not a WsdlTestStep.
Test 3:
TestStepConfig testStepConfig = TestStepConfig.Factory.newInstance();
testStepConfig.setType(DataSourceStepFactory.DATASOURCE_TYPE);
testStepConfig.setName(testStepName);
testStepConfig.setDescription(description);
WsdlDataSourceTestStep testStep = new WsdlDataSourceTestStep(testCase,testStepConfig , true);
// The created testStep is of type com.eviware.soapui.impl.wsdl.teststeps.registry.ProPlaceholderStepFactory$WsdlProPlaceholderTestStep, so not really a WsdlDataSourceTestStep.
So here my question:
How do I create a datasource test step the right way?
Thanks in advance
i am building an java application using the SoapUI Pro API. My application shall allow the user to create a full SoapUI project (testsuites, testcases, teststeps and so on).
But I am encountering a problem creating the datasource test step.
I tried a few things which did not work :
Test 1:
WsdlDataSourceTestStep testStep = (WsdlDataSourceTestStep) testCase.addTestStep(DataSourceStepFactory.DATASOURCE_TYPE,testStepName);
testStep.setDescription(ExcelDataSource.TYPE);
// This sends a NullPointerException due to testStep being null.
Test 2:
WsdlTestStep testStep = testCase.addTestStep(DataSourceStepFactory.DATASOURCE_TYPE, testStepName);
// Without parsing the object is not null, but what I need is a WsdlDataSourceTestStep and not a WsdlTestStep.
Test 3:
TestStepConfig testStepConfig = TestStepConfig.Factory.newInstance();
testStepConfig.setType(DataSourceStepFactory.DATASOURCE_TYPE);
testStepConfig.setName(testStepName);
testStepConfig.setDescription(description);
WsdlDataSourceTestStep testStep = new WsdlDataSourceTestStep(testCase,testStepConfig , true);
// The created testStep is of type com.eviware.soapui.impl.wsdl.teststeps.registry.ProPlaceholderStepFactory$WsdlProPlaceholderTestStep, so not really a WsdlDataSourceTestStep.
So here my question:
How do I create a datasource test step the right way?
Thanks in advance
