Forum Discussion

Raichu's avatar
Raichu
New Contributor
3 years ago
Solved

"Run TestCase" and use properties of target TestSuite

Hello community,

 

I have a question regarding remote execution of TestCases - I want to execute a TestCase in TestSuite A in another TestSuite, B, and

use properties of the Target TestSuite B instead of those in the called context A.

 

Is there a way to use the properties of the target context B? I have not found one in the settings menu of "Run TestCase" and am now attempting to

do it by scripting. The problem is, that I want to make a TestCase that will do the specified "anywhere" - so the best option would be to somehow be able to get

context B through Groovy.

 

Can anyone help?

  • Hm, I found two work-arounds:

    call a testStep from the target context -

     

    in the testStep-properties, create vars:

     

    one - create a var with the TestSuite name from which I want to get the properties as value. This way I can reference the TestSuite in a script.

     

    two - create a var with the value calling another variable in the target context, i.e. var A - value=(${#TestSuite#targetvariable})

     

    I am still not satisfied completely. I think there must be a way to tell where a testStep is called from programatically, i.e. to find the target context from within the called testCase

4 Replies

  • jovyjigs's avatar
    jovyjigs
    Occasional Contributor

    Hey Raichu,

     

    I 've achieved something similar by using "Run TestCase" Options.

    Under return properties, if you uncheck the checkbox, it will return property from target test case and not from the test case that you are trying to call.

    Hope that helps your case

    • Raichu's avatar
      Raichu
      New Contributor

      Hello and thank you for your answer. I see what you mean - if the boxes on returning origin properties are not checked, then the properties that are transferred into the test case are used.

       

      What I wanted to do, however, is reference a property from the calling TestSuite, say in a SOAP Call - i.e. ${#TestSuite#Property}.

      In my test, this reference always defaults to the origin Test Suite property - not the one in the context, where the TestCase is called.

      The problem with using properties in the called Test Step is, that I need to first transfer the properties there, which means that I need an additional Step to do it.

       

      Do you have any suggestions?

      • Raichu's avatar
        Raichu
        New Contributor

        Hm, I found two work-arounds:

        call a testStep from the target context -

         

        in the testStep-properties, create vars:

         

        one - create a var with the TestSuite name from which I want to get the properties as value. This way I can reference the TestSuite in a script.

         

        two - create a var with the value calling another variable in the target context, i.e. var A - value=(${#TestSuite#targetvariable})

         

        I am still not satisfied completely. I think there must be a way to tell where a testStep is called from programatically, i.e. to find the target context from within the called testCase