Forum Discussion

p19's avatar
p19
New Contributor
7 years ago

Cross Project - Ready API TestSuite.name returns null

Hi 

 

I have a requirement to run a test step from another project and I am a newbie to Ready API. 

 

I googled and got to the point of getting the Project Name but stuck after this point.

 

Couldn't access the TestSuite as it returns null. Below is the code Snippet i used

 

/ Replace names of a project, test suite, case and step with those you need.

// Connecting to the test step in another project.
def prj = testRunner.testCase.testSuite.project.workspace.getProjectByName("CMSToPMSService")
log.info("Project is: " + prj.name) - Retrieves the Project Name properly
tSuite = prj.getTestSuiteByName("InitiateReverseActivationTestSuite") --- Null for tSuite.
log.info("Test Suite is: " + tSuite.name) 

 

See screenshots attached.

 

Not sure whats is wrong

 

Thanks in advance.

 

P

 

 

2 Replies

  • sanj's avatar
    sanj
    Super Contributor

    Have not tried your code yet but for starters

    make sure you using the calls properly and make sure project name is correct.

    I am sure we have lots of people here who can try your code and point out the issue.

     

    • p19's avatar
      p19
      New Contributor

      Thanks Sanj. Sorted. Nothing to do with Code but the xml wasn't refreshed with the new Test Suite I created. My bad.