Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How to extract data from a test and use it later

Options
LegacyForum
LegacyForum Posts: 1,664 ✭✭
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

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Options
    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