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.

Update data into write file through coding?

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

I have a scenario where in I have to get values from the response xml of my first operation and set them as input to my second operation. I was thinking of using a writable data source where in I could get the dynamic values and set it as input to second test. Can I use an extension tool to somehow write a code to update the value in writable datasource. I have around 150 parameters in the response so it would be time consuming to add xpath of each element in the xml databankand then using modify tab, write it to the writable data source.

Thanks a lot in advance
Tagged:

Comments

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Hi Sayana,

    Why do you need to use a writable data source? I don't understand why in this case you would need to use the writable datasource as opposed to just using the xml data bank to store the values for the input of the next test. This is typically how information is passed between two tests. Firstly, I would suggest looking at the tutorial section which has to do with using a databank, you can find this by clicking Help > Help Contents, then navigating to Parasoft SOAtest User's Guide > SOAtest Tutorial > Scenario Testing . One trick that might make your life easier is that if you have large chunks of xml of the response which exactly matches up to the xml structure of the request, you could add the top level xpath in the data bank, then in the request, select that same top level element and choose "Replace with data source value". Another trick which would make the parameterization process quicker is to "Use data source wizard" (this is an option you can select in the dropdown as opposed to "fixed" or "parameterized") in the request of the second test then you can add the xpath to the databank that way. So rather then having to add the xpath in the databank of the first test, then set the value to parameterized in the second test, you can essentially do it in one go. Let me know if you have any questions about this.

    Regards,

    Jon
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Hi Sayana,

    To follow up with you in case I didn't fully answer your question. There is not a way to update the writable datasource using scripting in the way that you desire, it is updated using a data bank, is there something that you think SOAtest should be able to do in this respect? I would be happy to file a feature request if you think there is functionality which would benefit you in this respect. Perhaps a mass update on xpaths in the databank? Remember you can add many xpaths at once, for example by shift + clicking., Also did some of my other suggestions help?

    Regards,

    Jon
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    edited December 2016
    Hi Jon,

    I tried out your solution and it did solve my problem.

    Thanks a lot.

Tagged