TestProject Forum

Output parameter order cause issues

So I’m facing this weird issue where TP tries to return a parameter from a test before a value is assigned

Requested to set the value of sub-test output parameter “rent” to test parameter “rent”, but “rent” is never set!

I have no idea why this happens or how to fix it, from what I can see “rent” is the second parameter that is returned by the test and I can’t change the order.

I used to get this error with running nested tests and it took me some time to work out why (BTW I don’t think the order displayed has any bearing on execution order).

In my case, (from memory) the issue related to either:

  1. Having the nested {Rent} output parameter populated with the higher level {rent} recipient parameter when there is actually no intention to instantiate it (or no need to use it). If you don’t need the value from the nested test then delete it from the output field. Or…
  2. Make sure the nested test step is actually instantiating the output {rent} parameter correctly (if there is no value to pass then this explains the error message. Maybe you could set NULL as a default value to the nested {rent} so if it’s not instantiated then it doesn’t fail.
  3. Be sure to check the nested test step for {rent} does not have a condition that skips the step (e.g. you copied a step and forgot to alter/remove the condition).

Hope this helps :grinning:… I would need more information about your nested tests to fully grasp what is happening.

The error is displayed when the output parameter of your nested test is not assigned any value and returned to your parent test. As pointed out by @Doug.Voon , if your nested parameter is not instantiated (has no value to it), it will cause this issue.

To resolve the issue:

  1. Make sure your output parameter from the nested test always has a value before it completes its execution. (Add an additional step just to make sure it has a value, if it is not assigned throughout the test).
  2. If you are not planning to use the output parameter of the nested test in your parent test, do not create the parameters into the parent test when prompted during creating the nested test inside the parent test.

I have tried all suggestions and neither works. I have also re-created some parameters and now they are at the bottom of the output list but the error is still thrown for the 2nd parameter.
I got no idea why this happens or how to fix it, any help is welcome. I would expect this error to happen if the parameter doesn’t have a value assigned after the test is finished, not in the middle.

Looks like the “Generate code” function it is also broken, I was hopping I could use the code to debug this problem but I’m unable to download it.

In order to better debug the “subtest”, try using the “run” button next to the test, rather than running the test by “recording” it. If you use the “run” button, it will actually show each step and the parameters being passed to it. This allows for much better debugging than running the test via the “record” session (as this will just output the results from each test as you have found above). It will output the results to the “report” page, allowing you to dive, with screenshots and parameters through your tests.