Forum Discussion

erikmollerberg's avatar
erikmollerberg
New Contributor
10 years ago

Transfer part of response to new testcase, as part of the url

Hi,

 

I need to transfer part of the response as part of the next testcases URL.

 

The problem is that an normal property transfer needs a property name to popolate the URL.

 

So I want to transfer som thing like this:

 

Response body:

 

ref=ref%blablabla

 

Following request: https://myurl/api2/method/submethod.xml/?key=mykey&ref%blablabla

 

Any ideas?

  • nmrao's avatar
    nmrao
    Icon for Champion Level 2 rankChampion Level 2

    The general and best approach, IMO, is that each test should be independent. Not clubbed or not to have dependency on previous tests.

     

    May be you wanted to reconsider how the tests are desinged? 

    • erikmollerberg's avatar
      erikmollerberg
      New Contributor
      Hi,
      Thank you for your answer.
      The thing is that this is a key api that I am testning.
      The first test is to create a key. The response body returns a api key for a specific method.
      next test to set a new profil for The key and so on.
      In this case it I want to take The response body key from test1 and use in test 2.

      how to do this ?
      • nmrao's avatar
        nmrao
        Icon for Champion Level 2 rankChampion Level 2
        Thats what I was exactly saying. Either have the step to get the key in the same test case as a test step. Or use it as pre-requisite(you use Events for the same) before starting execution of test cases i.e., get the key and store it in suite level and that should not actually be a test case as you say.