Forum Discussion

kamahade's avatar
kamahade
Regular Contributor
15 years ago

com.eviware.soapui.config.TestStepConfig

TestSuite implementation for WSDL projects. com.eviware.soapui.impl.wsdl Class WsdlTestSuite constructor method has following signature

WsdlTestSuite(WsdlProject project, com.eviware.soapui.config.TestSuiteConfig config)

Here what is ? com.eviware.soapui.config.TestSuiteConfig ... I could not get to know how to configure this or declare this.

If I want to use WsdlTestSuite , how do I use it ?

Class WsdlTestCase also uses this com.eviware.soapui.config.TestSuiteConfig which I could not see it anywhere. When I tried, am getting error

[size=50]org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script19.groovy: 5: You cannot create an instance from the abstract interface 'com.eviware.soapui.config.TestSuiteConfig'. @ line[/size]


How do I define my Project and start working on that ?

def mytestsuite = new com.eviware.soapui.impl.wsdl.WsdlTestSuite(proj,config); ? 

8 Replies

  • kamahade's avatar
    kamahade
    Regular Contributor
    robert,

    After checking API docs only I have posted this Question.

    Can you point out in API doc,which page/line number talks about this TestStepConfig ?
  • Hello,

    To create a test suite use WsdlProject.addNewTestSuite(<test suite name>). Adding a test suite to a project, test case to test suite and test step to test case is done by using addNew... methods.

    Hope this helps,
    robert
  • kamahade's avatar
    kamahade
    Regular Contributor
    I did the following

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

    WsdlProject project = new WsdlProject("D:\\soapui-release-B\\ReleB-auto-soapui-project.xml");
    log.info project.path;
    log.info project.getTestSuiteCount();
    project.addNewTestSuite("kamahade");
    log.info project.getTestSuiteCount();
    project.save();
    for ( TestSuite in project.getTestSuiteList() )
    log.info TestSuite.getLabel();


    I'm doing this inside the project D:\\soapui-release-B\\ReleB-auto-soapui-project.xml

    However,I can not able to see new testsuite in the "Navigator" window left side.

    Also, I got another doubt, How do I run any groovy script outside a project?
  • Hello,

    Why are doing this:

    WsdlProject project = new WsdlProject("D:\\soapui-release-B\\ReleB-auto-soapui-project.xml");



    If you are doing this from Groovy test step than you can access to project it belongs to with:


    context.testCase.testSuite.project


    What do you mean running a groovy script outside a project? You can have external scripts in scripts folder under {soapui.home}/bin or in some other folder but that you have to point your project to it( set Script Library property ).

    Let me know does this helps,
    robert
  • kamahade's avatar
    kamahade
    Regular Contributor
    OK.... I want to automatically

    create a project,
    add WSDL,
    add testsuite for each operation
    add several test steps to each of my testcase

    I want to do all this through a groovy script. Groovy script may be run only inside a SOAPUI project ? I posted this as well today

    I refereed this post
  • Hello,

    If this is executing inside of soapUI it has to be part of project or event listener. If it executes outside soapUI it will not be visible in workspace, also you can load a project inside another in groovy script but it limited to that script than, since it is not add to workspace. I suggest you check API and code to see how to achieve all this.

    robert
  • kamahade's avatar
    kamahade
    Regular Contributor
    Help me to create a soapui project and add a WSDL through a groovy script outside SOAPUIPRO.