Forum Discussion

aogunsola_asi's avatar
aogunsola_asi
New Contributor
9 years ago
Solved

How do I cleanly reuse a testcase that requires input and output parameters in other testcases?

I'm trying to set up some test suites for a REST api using SoapUI NG Pro. I first need to login and retrieve the auth code, then pass that to the next step. 

 

I have suite1 with testcase login and:

  1. properties step for credentials
  2. POST login
  3. property transfer to save auth code returned by #2

This runs successfully by itself

 

Then I add suite2 with testcase get and:

  1. properties steps for test-specific credentials
  2. Run testcase (calling testcase login from suite1)
  3. GET product

This keeps pulling the credentials set in suite1 instead of suite2 and it fails.

 

In suite2 #2, how do I access and set the input (login creds) and output (auth code) parameters for the testcase being called? The properties are not listed when to create the "run testcase", unless i create custom parameters on suite1.

 

Can anyone recommend the corect way to do this? I can't seem to get the correct sequence of steps. I have already reviewed the Help docs and searched the community, and found no clear example to follow. Thanks.

 

 

 

  • There were multiple causes. I needed to use custom properties and there was a bug that Support helped resolve. Problem solved. Thanks.

4 Replies

  • How did you set up your testsuite 2?if you cloned testsuite1 the it wont work that well.I would recomend creating clean interface tests and create testsuite from that.

    hope this helps

      • tomlee2's avatar
        tomlee2
        New Contributor

        Have you try setPropertyValue? You can put the value in different "Custom Property" level as you prefer.

  • There were multiple causes. I needed to use custom properties and there was a bug that Support helped resolve. Problem solved. Thanks.