Forum Discussion

Marc_Commandeur's avatar
Marc_Commandeur
Occasional Contributor
16 years ago

Workings of run TestCase step

Hi all,

I set up a generic TestCase 'authenticate' that uses some TestCase properties like 'username' and 'password'.
I use this TestCase as a TestStep in an other TestCase. I fill the properties (not marked as return-properties) in the TestStep.
The assertion on the response of the request fails (I expect 'SUCCESS' but get 'USERNAME_INVALID'. It is as if the request does not contain the correct data. I expect the corresponding properties in the target TestCase to be set from the Run TestCase Step but can not find any data.

When using different data should I see the data used in the request change in the target TestCase? If not how can I see what data is sent in the request?

Pro 2.0.2 version.

Thanks,

Marc.

4 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    just to make sure; are you actually transferring the username/password TestCase properties in the authenticate TestCase to the corresponding username/password in the requests where you want to use them (using a Poperty-transfer)? (Just because they are named the same doesn't mean they will automatically get each others values..)

    regards!

    /Ole
    eviware.com
  • Marc_Commandeur's avatar
    Marc_Commandeur
    Occasional Contributor
    Hello Ole,

    Thanks for the response that late in the evening.

    omatzura wrote:

    are you actually transferring the username/password TestCase properties in the authenticate TestCase to the corresponding username/password in the requests where you want to use them (using a Poperty-transfer)?


    No I am not

    omatzura wrote:

    (Just because they are named the same doesn't mean they will automatically get each others values..)


    That sounds quite logical but I read the manual and found this:
    "When running the TestStep, the following happens:
    1. The properties containing values and not marked as return properties are copied to the target TestCase". I never considered copying the properties myself. I'll try that now.
    (see point 1 under "Execution" at http://www.soapui.org/userguide/functio ... estep.html)
  • Marc_Commandeur's avatar
    Marc_Commandeur
    Occasional Contributor
    Hi again,

    I tried copying the properties myself but, the target TestCase is out of scope of the Property Transfer because it is in another TestSuite.

    Another thing I noticed is that the properties marked as return properties do get copied back to the Run TestCase step. Just as the documentation says so on http://www.soapui.org/userguide/functio ... estep.html (point 3 under Execution).

    So, in the same Run TestCase teststep the first part of the execution "The properties containing values and not marked as return properties are copied to the target TestCase." does not seem to work for me and the third part "The properties marked as return properties are copied back from the target TestCase to the Run TestCase step." does work.

    Do you have any idea where I am doing something wrong?

    Marc.
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Marc,

    sorry for being unclear; I think you need to add a property-transfer at the beginning of the TestCase you are calling that transfers the TestCase properties to the desired Request(s) in that TestCase. Alternatively you could use property-expansions in the username/password fields of those requests by entering

    ${#TestCase#username}

    and

    ${#TestCase#password}

    in these fields respectively (in this case you wont need a property-transfer since the TestCase properties will be expanded into these fields upon submittal)..

    Hope this helps!

    regards,

    /Ole
    eviware.com