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

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

  • OmarROmarR Posts: 205 admin

    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_parasoftbenken_parasoft Posts: 462 ✭✭✭

    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.

  • Hi OmarR ,

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

Sign In or Register to comment.