Forum Discussion

asseldonk01's avatar
asseldonk01
Contributor
12 years ago

Invoking a testcase in another project under hudson

I have read a topic about calling a testcase from another soapui project. That solution can be used if you run these tests manually, they call that project by name.
If automated, for example via hudson, each testproject runs in a seperate instance of soapui sequentially or parallel.
I would like to now if there is a way to do this besides sharing information via files. The assumption is that these projects reside in the same folder.

Thanks
Ed van Asseldonk

3 Replies

  • SiKing's avatar
    SiKing
    Community Expert
    In Hudson, or any CI, you are not able to control where different projects get checked out.
    Further, the SoapUI testrunner is only "aware" of one project at a time.

    The best workaround for this is to consider restructuring your SoapUI projects correctly, such that different projects have no dependencies between them.
  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    hi, you may be interested by this post: viewtopic.php?f=2&t=23632
    it is about transferring properties between different projects in SoapUI, but actually, this is very closed in term of coding and environment
  • Hi, thanks for your suggestions. I also got hold to this code which seems to work by getting the property from another project.

    import com.eviware.soapui.impl.wsdl.WsdlProject;

    //get project
    def project = null
    def workspace = testRunner.testCase.testSuite.project.getWorkspace();

    //if running Soapui
    if(workspace != null){
    project = workspace.getProjectByName("DataSinkTest 2")
    }
    //if running in Jenkins or hudson
    else{
    project = new WsdlProject("DataSinkTest-2-soapui-project.xml");
    }