Forum Discussion

TommyTester's avatar
TommyTester
Occasional Contributor
5 years ago

Groovy script to open Project

Hi,   I'm writing a Groovy script step to run a test case that is within another project (Project 1 in the code snippet below). This code works if Project 1 is already open, however it fails on the...
  • groovyguy's avatar
    5 years ago

    Here's a quick snippet you may be able to use.

     

    def workspace = context.testCase.testSuite.project.workspace;
    
    def project = workspace.getProjectByName("PROJECTNAME");
    
    if (project.isOpen() == false)
    {
         workspace.openProject(project);
    }