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.

Parameterization of SOAtest Tests

Options
LegacyForum
LegacyForum Posts: 1,664 ✭✭
edited December 2016 in SOAtest
Hi,

I am new to SOA Testing as well as the SOATest tool and hence may be asking a basic question but needed immediate help.I have to run a bunch of tests which are xmls being sent over http.The tool that I am using within SOA Test is 'Messaging Service' which would sent and receive pure xmls. Now , is there a process wherein my request xmls can read values for a few of it's tags from a datasource like an excel file and after the response is obtained for each of the tests run , the values in the tags of the response can be stored in another or the same excel file.Also, information on some validation process of the response xmls if existing would be fine.

Awaiting your reply.
Thanks.
Tagged:

Comments

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Options
    Indranil -

    You can create an excel data source and parameterize your xml request using that data source (since we do not have a "Messaging Service" tool, I am assuming you are using a "Messaging Client", which requires a schema to define your xml messages).

    First, go to the root node of the test suite, right click and select Add New > Data Source... and then click Excel. In the resulting window, input the file path to your excel data source. Note that your Excel file has to be formatted so that each column contains a data set for a single element, which the first row of each column being a label for the data set (i.e. column 1: [Countries, U.S.A., China, Japan, Britain, Germany]). Change the name of your excel data source from "New Datasource" to something else, and hit save. Click "Show Columns" to verify that your data sets in each column are there.

    Now, go back to your Messaging Client. Close the editor and reopen it to refresh the tool. On the top right hand corner, verify that the tool detects the data source, which will display whichever name you named the data source. Copy paste your xml message into the editor in "Input Mode: Literal", then select "Input Mode: Form Input". For the elements that you want to parameterize, click on the element and change the dropdown from "Fixed" to "Parameterized", then select the data source column. Hit save and run the test; SOAtest will repeat the test once for each data point in the excel file.

    To store the XML response, right click the Messaging Client and select Add Output > Response > Traffic. If you add an XML Data Bank, you can use it to store values and send them to a writable data source. You would run the Messaging Client tool once through first to populate the elements, select the elements you want to store, click "Modify" on each of them, select "Data source column", and select Writable Data source column (you will need to have added a Writable Data Source under Data Sources, making sure that it's set to one of the Standard Test Modes: Overwrite or Append). In Add Output > Response > Traffic, you can also add Write File, which will simply record the traffic in a .txt file.

    Lastly, for validating XML response messages, you can go to Add Output > Response > Traffic and select XML Assertor to check whether the returned elements match the values you expect, or XML Validator to check the validity of the actual message itself.

    Please also take a look at the help documentation for each of these features, as well as our SOAtest tutorial. If you need further help on these issues, I encourage you to contact our technical support staff at soatestsupport@parasoft.com.

    Hi,

    I am new to SOA Testing as well as the SOATest tool and hence may be asking a basic question but needed immediate help.I have to run a bunch of tests which are xmls being sent over http.The tool that I am using within SOA Test is 'Messaging Service' which would sent and receive pure xmls. Now , is there a process wherein my request xmls can read values for a few of it's tags from a datasource like an excel file and after the response is obtained for each of the tests run , the values in the tags of the response can be stored in another or the same excel file.Also, information on some validation process of the response xmls if existing would be fine.

    Awaiting your reply.
    Thanks.

  • trand2
    trand2 Posts: 8
    Options

    Hi,

    Is there any way we can parameterize entire block of request XML (this block contains many XML elements and attributes)? The above shows me how to parameterize certain attributes and values of certain elements. However, my test data requires that a large chunk of XML in the request message parameterized. This is because there are too many elements and attributes in each chunk to parameterize effectively using the method you described (there would have to be hundreds of columns in the excel sheet, and sometimes the multiplicity of elements in the XML block varies as well)

    Ideally, I would like to have a collection 100+ XML files. Each XML file contains the same XML block, but different element values and attributes values. During test execution in SOATest, an element in the request XML message is inspected by SOATest called "refererenceID". This referenceID is used by SOATest to pull in the contents of the file with the same name and plug it into the request message.

    Please let me know if this is possible and if there is a more elegant way to handle such requirements.

    Thanks in advance for your help.

  • Ramiro Martinez
    Ramiro Martinez Posts: 53 admin
    Options

    Hi Trand2,

    Yes, you can add multiple elements using parameterization.
    Have you tried the File data source for your test?
    Check this forum post for more information on the file data source:
    forums.parasoft.com/discussion/2756/loop-through-files-in-a-directory-with-post-http-request-for-each-file

    Please see the post made by Thomas, Omar, and myself for examples of calling files for the request.

    If the files contain chunks of XML then you can also call them from within your test:

    It may be necessary to disable the "Encode value" check box as shown above.

    This will add the XML into the request.

    This can done with other data sources as well, but if you have your XML stored in multiple files this is possibly the most convenient.

    (This scenario was created using SOATest 9.10.0, but holds for older versions of SOATest)

  • trand2
    trand2 Posts: 8
    Options

    Thanks for the quick reply. This is definitely helpful!

    I am now able to parameterize using file contents as describe above.

    However, it seems that I am able to only choose one Data Source. I need to parameterize using a mixture of data sources. How can I go about parameterizing part of my request message using Excel columns and part of the message using File Contents.

    Also, would you mind guiding me on the second piece, where a lookup is required (as opposed to plugging in the contents of ALL file in the data source directory)?

    "During test execution in SOATest, an element in the request XML message is inspected by SOATest called "refererenceID". This referenceID is used by SOATest to pull in the contents of the file with the same name and plug it into the request message."

  • Ramiro Martinez
    Ramiro Martinez Posts: 53 admin
    Options

    Hi Trand2,

    If you need to use multiple data sources at the same time, I suggest looking into the Aggregate data source.
    The aggregate data source allows you to call on multiple data source in a single tool.
    Details can be found in the SOATest Help>Help Content,
    Search "aggregate data source", select "Parameterizing Tools with Data Source Values, Variables, and Extracted Values" and move to the "Configuring an Aggregate Data Source that Combines Multiple Data Sources " section.

    As for your second request, there is no built in feature for request correlation, it may be possible with a custom script.

Tagged