Forum Discussion

patelakhil's avatar
patelakhil
Contributor
16 years ago

SOAPUI PRO - How to run soapui project from JAVA?

Hi,

I am writing the wrapper above the testrunner to run the tests of the project from JAVA itselft.

I think that I can use SOAPUIProTestRunner class but there is not in API document available for it. So where can I find the API doc for this class?

Is any body have sample or example for SOAPUIProTestRunner class invoke from JAVA?

Thanks,
Akhilkumar Patel
  • Hi,

    we are not providing API documentation for Pro version, but you can use invoke testRunner from Java as command line tool, for example:

    Runtime.getRuntime().exec("testrunner.bat -hlocalhost:8080 -a -fresults c:\projects\my-soapui-project.xml");


    more information you can find here
    http://www.soapui.org/userguide/command ... ional.html


    Hope this helps
    Regards Nebojsa
  • Hi Nebojsa

    Thanks for this help.

    Basically right now I am doing as same way as you suggested but instead of execuring through command line, I want to instantiate the test runner class, set the options and properties and than some method line run()/start() etc, I should be able to run the tests of soapui proejct.

    As I have seen that some example exists for non pro version on soapui site:
    http://www.soapui.org/userguide/command ... unner.html

    The example is :
    public void testRunner() throws Exception
    {
    SoapUITestCaseRunner runner = new SoapUITestCaseRunner();
    runner.setProjectFile( "src/dist/sample-soapui-project.xml" );
    runner.run();
    }

    But we have created project using some features of PRO version and I think due to that we cannot use above mentioned code to run the test runner from java.

    So do we have same thing available for testcase runner of PRO version?
  • Hi!

    Just use the SoapUIProTestCaseRunner instead (it extends the SoapUITestCaseRunner), you can find it in the soapui-pro jar file..

    does that help?

    regards,

    /Ole
    eviware.com
  • Thanks Hero,

    I check the class but it do not have run method.

    So could you please provide some samples for same?

    Regards,
    Akhilkumar Patel - The Test Automation Architecture
  • Hello!

    SoapUIProTestCaseRunner extends SoapUITestCaseRunner, so it inherits all of its methods, including the run() method. The API for SoapUITestCaseRunner is available here. Any code that uses SoapUITestCaseRunner should also work on SoapUIProTestCaseRunner.

    Regards,
    Dain
    eviware.com
  • Hi,

    Thanks for same. As per your suggestion I am able to write a code without compiling errors. The testing is pending but it seems that it will work fine.

    Thanks again for your prompt response.
    Akhilkumar Patel - Test Automation Architecture.