How to extract data from a test and use it later

LegacyForumLegacyForum Posts: 1,669 ✭✭
edited December 2016 in SOAtest
Hi there.

I'm a newbie and i need some help with Soaptest:

I need to perform a lot of tests, many of which need as input some data from the previous test. In my first test i send some information for authentication (user, password), and i receive many xml elements, one of which is 'sessionNumber'. Then, i need to use this session number in the following tests.
I've been doing this manually, but now i have so many tests that it would be helpful to do it automatically. I guess that it is possible to do this with Soaptest, but i still don't know how to.

Thanks in advance
Tagged:

Comments

  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    Hi Eddie,

    I ran into this the other day. Hope this will help you.

    I am assuming that you have loaded your WSDL and both of your method tests, the one that returns the session number (test 1) and the one that needs the session number (test 2), are in the same test suite.

    - If the above is correct then right click on test 1 and add an output.

    - Add Output > XML Response > New Output > XML Data Bank.

    - Run test 1 to populate the XML Data Bank

    - Click on XML Data Bank and you will see the Expected XML section populated. Click on the Add button below the Selected XPaths and add an XPath. You should see your "Session Number" in that list. After selecting click "OK".

    Now on to test 2

    - Click on Test 2 and you will see a body section. If you change the value drop down from automatic to form, you will then see a list of your objects.

    - From the list of objects, change the object that takes the session number from "fixed" to "parameterized".

    - Once changed to Parameterized, you should then be able to click on the drop down field to the right of "parameterized" and select your "Test 1: Session Number"

    Good luck,

    Beth
Sign In or Register to comment.