Forum Discussion

Liberty_Informa's avatar
Liberty_Informa
Regular Contributor
13 years ago

[Resolved] Execute Setup Project from Command line

Hi

I use following script to execute set-up project from all the project. Set-up project populates set-up data which is necessary to run individual projects.

/* Calling Setup Project */

for(project in com.eviware.soapui.SoapUI.workspace.projectList) {
if(project.open && project.name == "SetupDynamicTestData") {
log.info " ${text*5} Running project: " + project.name
project.run( null, false )
}
}


This works perfectly on my local with running soapUI project within the tool.

We also run all the projects daily at some scheduled time on remote server. There we run through command line. Above script doesn't work there due to the statement 'com.eviware.soapui.SoapUI.workspace.projectList'

Can you tell me how can I make it working through command line so that set-up project is run within all domain projects?

Thanks

9 Replies

  • Hi!

    com.eviware.soapui.SoapUI.workspace.projectList, and workspaces as a concept, is not available when running from the testrunner (commandline).
    So I'm afraid that you have to rewrite your script to load the SetupDynamicTestData project directly.

    --
    Regards

    Erik
    SmartBear Sweden
  • Liberty_Informa's avatar
    Liberty_Informa
    Regular Contributor
    Thanks Erik

    It would be great if you could give me some example or any direction to achieve this.

    Thanks again!
  • Hi,

    you can load a project with

    def project = new WsdlProjectPro( <path to project> )

    and from their make the same calls as you did in your script that retrieved the project from the workspace...

    Hope this helps!

    regards,

    /Ole
    SmartBear Software
  • Liberty_Informa's avatar
    Liberty_Informa
    Regular Contributor
    Hi Ole,

    I changed the code with the following


    /* Calling Setup Project */
    def setupProjectPath = commonPath + "/SetupProjects/SetupData/SetupDynamicTestData-soapui-project"
    log.info "Setup Project path: " + setupProjectPath

    def setupProject = new WsdlProjectPro(setupProjectPath)
    log.info "Setup Project name: " + setupProject
    if(setupProject.open)
    {
    setupProject.run( null, false )
    }


    I can see two lines printed in the log


    Mon Oct 29 06:54:37 EDT 2012:INFO: Setup Project path: D:\Workspaces\xxxServices\xxxTests\soapui/SetupProjects/SetupData/SetupDynamicTestData-soapui-project
    Mon Oct 29 06:54:37 EDT 2012:INFO: Setup Project name: com.eviware.soapui.impl.wsdl.WsdlProjectPro@704523ae



    However in the error log I can see error as

    java.net.MalformedURLException: unknown protocol:d

    Any hint?
  • Liberty_Informa's avatar
    Liberty_Informa
    Regular Contributor
    Hi

    I added .xml in the project name which seems to be working but I am not able to see all the logs as somehow the project from where I am calling setupProject, the project consumes the whole memory and soapUI crashes. It has happened number of times now.

    Thanks
  • Hi!

    Sorry, but could you rephrase " am not able to see all the logs as somehow the project from where I am calling setupProject", I'm not sure I'm following you.
    Which logs are you missing?

    --
    Regards

    Erik
    SmartBear Sweden
  • Liberty_Informa's avatar
    Liberty_Informa
    Regular Contributor
    Hi Erik

    I mean to say - I am calling Setup project in the project-load script of one more project. The script I am using is provided in my previous post. However When the calling project loads, soapUI is consuming the whole memory. As a result, I am not able to see 'script log' or 'error log' to ascertain whether project load script of calling project has successfully invoked setup Project or not.

    As such I am able to load setup project as well as Calling project successfully, if I load them separately.

    The problem starts when I introduce the above script which calls setup project. I am not sure why it consumes so much of memory.

    I hope it helps.

    Thanks