Matt_Johnson
16 years agoNew Contributor
[HELP] Trying to use SoapUI JAR to make changes
I am trying to use Eclipse and the SoapUI JAR to make changes to project files. I am trying to add test steps to existing test cases, but I cannot find a way to use the API to do this. I have tried trudging through the Javadoc, but that is a pretty frustrating trip because of the lack of information in the Javadoc. I would appreciate any help I can get. Here is a sniplet of my current code:
public static void main(String[] args) {
try {
WsdlProjectPro project = new WsdlProjectPro("C:\\SoapUI\\soap.xml");
for (TestSuite testSuite : project.getTestSuiteList()) {
for (TestCase testCase : testSuite.getTestCaseList()) {
for (TestStep testStep : testCase.getTestStepList()) {
String name = testStep.getName();
if (name.endsWith("-correct")) {
GenerateSQLFaults(testStep);
}
}
}
}
} catch (XmlException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SoapUIException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private static void GenerateSQLFaults(TestStep testStep) {
WsdlTestCase testCase = (WsdlTestCase) testStep.getTestCase();
TestSuite testSuite = testCase.getTestSuite();
HttpRequestStepFactory factory = new HttpRequestStepFactory();
TestStepConfig cfg = factory.createNewTestStep(testCase, "name"); // <-- this fails because of UI calls it is trying to make
}