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.

custom script to choose Response by name

Options
asif_11122
asif_11122 Posts: 8

Hi , I'm new to parasoft . Can anyone help with a script on how to return response by Response name under Response tab using custom groovy script under Responder Correlation tab ?

Answers

  • williammccusker
    williammccusker Posts: 654 ✭✭✭
    Options

    Hi,

    What is the scripting trying to do? The contents of the Response tab will automatically be returned when a request message matches the correlation values. The way the Responder works in an incoming message is checked against the Responder Correlations, if that matches then the responder will return its Response. Scripting could be used if there are some special values, or alterations of the response that need to be made that can't be done using built-in tools.

    Knowing a bit more about your specific use case would help us to suggest a script or tools that could be used to accomplish your goal.

  • asif_11122
    asif_11122 Posts: 8
    edited May 2023
    Options

    groovy script is an existing functionality written in soapUI , I was wondering if there is a easy way to copy past entire script with minimum modification rather than rewriting entire functionality. Script extracts few attributes from incoming request , queries database , creates custom sections of response and concatenates multiple response sections in to one final xml response or passes DB parameters to existing response templates.

  • williammccusker
    williammccusker Posts: 654 ✭✭✭
    Options

    Hi,

    That tool uses a different approach than what Parasoft tools do. Instead of having to use a script to do correlation, extract values, and build the response much of that can be accomplished using easy to setup tools. The Responder Correlations will take care of matching without needing scripting. XML or JSON data banks can be used to extract values from the request. A DB Tool can be used to execute database queries. All of this can be done without scripting. I doubt that a script taken directly from another tool would work without significant changes.

  • asif_11122
    asif_11122 Posts: 8
    Options

    thanks for your input

  • williammccusker
    williammccusker Posts: 654 ✭✭✭
    Options

    Sorry, it wasn't quite what you had hoped! Hopefully, once you have used the tool you'll find that it's much easier to use since it involves less scripting!