jojoma
13 years agoOccasional Contributor
Editing SoapUi configuration file (.xml)
Hi,
so I was playing around with java API (through a separate project) a bit and wanted to automatically alter soapUi configuration. I managed to successfully read it like this:
WsdlProject project = new WsdlProject(configurationPath);
//Get a list of test suites
List<TestSuite> testSuiteList = project.getTestSuiteList();
for (TestSuite testSuite : testSuiteList) {
System.out.println("\nTest suite: " + testSuite.getName());
}
But I could not change anything this way. So I tried using classes from the .config package - like this:
ProjectConfig pc = ProjectConfig.Factory.parse(new FileInputStream(configurationPath));
//Get a list of test suites
List<TestSuiteConfig> testSuiteList = pc.getTestSuiteList();
for (TestSuiteConfig testSuiteConfig : testSuiteList) {
System.out.println("TestSuite name: " + testSuiteConfig.getName());
}
but this list is empty!!! Can anyone tell me why? File is successfully parsed but I cannot get a list of test suite to alter their configuration.
thanks in advance
so I was playing around with java API (through a separate project) a bit and wanted to automatically alter soapUi configuration. I managed to successfully read it like this:
WsdlProject project = new WsdlProject(configurationPath);
//Get a list of test suites
List<TestSuite> testSuiteList = project.getTestSuiteList();
for (TestSuite testSuite : testSuiteList) {
System.out.println("\nTest suite: " + testSuite.getName());
}
But I could not change anything this way. So I tried using classes from the .config package - like this:
ProjectConfig pc = ProjectConfig.Factory.parse(new FileInputStream(configurationPath));
//Get a list of test suites
List<TestSuiteConfig> testSuiteList = pc.getTestSuiteList();
for (TestSuiteConfig testSuiteConfig : testSuiteList) {
System.out.println("TestSuite name: " + testSuiteConfig.getName());
}
but this list is empty!!! Can anyone tell me why? File is successfully parsed but I cannot get a list of test suite to alter their configuration.
thanks in advance