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.

Edit/Update/Modify Test response object and write to another file using Groovy script

Options

Hi there ..

So I am pretty new to the groovy scripting world and some help on this would be appreciated ..

I am writing the response object of a test scenario to a text file on file system. (Response traffic -> Write File ) Now the objective to update the response using groovy script and save it in another file.

How to achieve that using Extension tool in SOATest ?

Extension Tool -> Return Value -> XML data bank.

Comments

  • OmarR
    OmarR Posts: 234 admin
    Options

    Good morning Sandeep,

    What type of changes do you plan to make? I recommend taking a look at the XML transformer to update your response instead. The updated or "transformed" response could then be written out to a separate file by using the write file tool again.

  • benken_parasoft
    benken_parasoft Posts: 1,231 ✭✭✭
    Options

    It might be helpful to better understand your full use case, like why you are writing response to the file in the first place, what type of change in the message you are trying to make, and what you intend to do with the modified message. There are often better alternatives than writing files and scripting.

  • SandeepSingh
    Options

    Hi OmarR ,

    Appreciate your prompt reply on this. I am exploring the Transform XML option and will let you know how it goes !! Thanks.