Forum Discussion

srcatwh's avatar
srcatwh
New Contributor
13 years ago

Calling one project from another

Apologies for potentially daft question, but here goes.

Does anybody know how I can call a script in one project from another?

We have a project that has become so large that it is being split up into smaller projects, and when it was all in one project we could call the data set up scripts from another test suite e.g.
othersuite = testRunner.testCase.testSuite.project.testSuites[anotherSuite]
However, when this project is split into smaller projects, we would like to be able to call the data setup from one location, rather than having to copy it into all of these new small projects e.g.
otherproject = testRunner.testCase.testSuite.project.??.projects[anotherproject]
trouble is I don't know what ?? is, if it exists at all.

Thanks in advance.

2 Replies

  • mkoron's avatar
    mkoron
    New Contributor
    you are looking for 'workspace', it's one step up in the hierarchy. you can access it in similar way as you access other test suites.

    try:
    list = testRunner.testCase.testSuite.project.workspace.getProjectList();
    list.each() { log.info ( it.getName() ) };



    PS. not sure why it pops the project list window, i haven't been using groovy for a while... just hit enter, info log shows names of all projects you have in your workspace...