Forum Discussion

pteichner's avatar
pteichner
Occasional Contributor
12 years ago

Runnin project with WsdlProjectPro

Hi,

I only have a quick question

def currentProject = new com.eviware.soapui.impl.wsdl.WsdlProjectPro("$projectFullLocation") 

// some logging stuff
log.info("GetName: " + currentProject.getName())
log.info("GetID: " + currentProject.getId())
currentProject.run()


for the last line I get an error:
groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.WsdlProjectPro.run() is applicable for argument types: ()


I've been reading the API guide and the run method is meant to be inherited from WsdlProject.
What am I doing wrong.

Thanks a lot,
Peter

3 Replies

  • pteichner's avatar
    pteichner
    Occasional Contributor
    I've been looking around and found some ideas and found the one below, but the problem is that this is using the WsdlProject rather than the WsdlProjectPro.

    Still loooking for how to Run my project. It returns the testSuites and the testCases, but I need to construct a runable object if I'm not incorrect.

    Again Thanks

    WsdlProject project = new WsdlProject(projectFile);
    for (TestSuite testSuite : project.getTestSuiteList()) {

    System.out.println("TestSuiteProject size......" + project.getTestSuiteList().size());
    System.out.println("TestSuiteProject......" + testSuite.getName());

    for (TestCase testCase : testSuite.getTestCaseList()) {

    System.out.println("TestCases........." + testCase.getName());
    testCase.setPropertyValue("UserName", userName);
    testCase.setPropertyValue("Password", passWord);

    StringToObjectMap properties = new StringToObjectMap();
    properties.put("username", userName);
    properties.put("password", passWord);
    properties.put("localhost", localHost);
    properties.put("HttpDefaultPort", port);
    List<TestStep> testSteps = testCase.getTestStepList();

    WsdlTestCaseRunner wsdlTestCaseRunner = new WsdlTestCaseRunner((WsdlTestCase) testCase, properties);
    WsdlTestRunContext wsdlTestRunContext = wsdlTestCaseRunner.createContext(properties);
    wsdlTestCaseRunner.run();
  • pteichner's avatar
    pteichner
    Occasional Contributor
    I've found the solution:

    def currentProject = new com.eviware.soapui.impl.wsdl.WsdlProjectPro("$projectFullLocation") 

    def projectRunner=new com.eviware.soapui.SoapUIProTestCaseRunner('ProjectRunner')
    def status = projectRunner.runProject(currentProject)


    Basically createa WsdlProjectPro object with the Project location, so it will have all it's parameters. Also create a runner object (SoapUIProTestCaseRunner) with a name. That object has a procedure runProject. This can also be done on the test suite or the test case level if you use WsdlProjectPro to read through the suites/testcases.