Forum Discussion

sumeet0420's avatar
sumeet0420
New Contributor
6 years ago

SoapUI - How to use the context variable set in test suite at the test case

Hello!

Is there any way I can use the context variable set in test suite at the test case.

 

Thanks

  • nmrao's avatar
    nmrao
    Champion Level 3

    How about this?

    context.testCase.testSuite.setPropertyValue('name', 'value')
    • sumeet0420's avatar
      sumeet0420
      New Contributor
      I want to pass a variable that is defined in test suite with value as an Object and use in the subsequent test cases.

      For eg. My test suite has set up script which defines a context variable as follows
      context.testSuiteVariable = new HelloWorld()

      I want to use this context.testSuiteVariable in my test case. Any idea how to achieve this?
      • nmrao's avatar
        nmrao
        Champion Level 3

        sumeet0420 

         

        You can simply use

        context.testSuiteVariable

         

        If you want an example, here you go: