Forum Discussion

apidev's avatar
apidev
New Contributor
7 years ago
Solved

Issue in setting property values between projects.

Hi,

 

I have two projects, ProjectA and ProjectB. Inside a testcase in ProjectA, I am trying to call a test from ProjectB. I use the groovy script below which I obtained from https://community.smartbear.com/t5/SoapUI-Open-Source/How-to-share-test-cases-between-Projects/td-p/35430

 

What I find is that I am able to execute the testcase in ProjectB(line 5), but the setPropertyValue step (line4) does not work. Any ideas why this is happening? I am using Ready! API 1.8.

 

project = testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getProjectByName(ProjectB)

testSuite = project.getTestSuiteByName(Library)

testCase = testSuite.getTestCaseByName(Test(a))

testRunner.testCase.setPropertyValue("a", "input") ----- does not work
runner = testCase.run(new com.eviware.soapui.support.types.StringToObjectMap(), false) ---- works

2 Replies

    • apidev's avatar
      apidev
      New Contributor

      Thanks, exploring the page helped me to figure out the solution.

       

      I needed to call

       

      testCase.setPropertyValue("a", "input")

       

      instead of 

       

      testRunner.testCase.setPropertyValue("a", "input"), since testRunner refers to current project.