Forum Discussion

jojoma's avatar
jojoma
Occasional Contributor
13 years ago

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

2 Replies

  • abhishek813's avatar
    abhishek813
    Frequent Contributor
    Sorry but i am going to ask a separate question..what are you trying to achieve by doing this.
  • jojoma's avatar
    jojoma
    Occasional Contributor
    Hi, completely valid question as this may not be the best way to achieve this...

    So what I want to do to automate soapUi runs/configuration changes etc.
    The only way I know how to do that is by using CLI which has some limitation. For example I can't alter soapUi configuration (statistics intervals, execution runs and so on...)

    But I've noticed this could easily be done with the code I've posted. That's why I decided to go that way. If you know of any other way, please let me know.