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.

Query regarding usage of Extension tool and data banks

Options
Simrit
Simrit Posts: 5

Hi Team,
I have used XML Data Bank to fetch few property values from the request
Can't we use these properties in the Traffic object -->Extension Tool while scripting?
The problem we are facing is when we use property from data bank in our java code we need to use ScriptingContext context in a method.

But if we use context.getValue("Generated Data Source","property from data bank") flow does does not consider extension tool in execution
How to overcome this problem

Comments

  • Thomas Moore
    Thomas Moore Posts: 82 admin
    Options

    Hi Simrit,

    There are a few things that might cause the script you have to not run the way you might expect.

    1. Is the Extension Tool chained to the Traffic Object or to Incoming Request Payload/Header? Alternately, is the script part of an element, where instead of selecting Fixed/Parameterized you selected Scripted? The behavior will be very different depending on where it's added.
    2. What are the arguments for your method? Depending on the answer for 1, it should either be methodName(Object input, ExtensionToolContext context) or just methodName(ScriptingContext context). Given the original post, I'm not sure which one applies here.
    3. How many methods are present in your script, and if it's more than one, is the correct one selected at the bottom of the extension tool?
    4. Which language is your extension tool using? This will let me help you easier :smile:
    5. If your extension tool is chained after your asset, is it located below the databank in order?
  • Simrit
    Simrit Posts: 5
    Options

    Hi Thomas,
    We were using Java code
    as suggested by you, we used methodName(Object input, ExtensionToolContext context) in our method name and it worked fine
    we are now able to use properties fetched from data bank in the extension tool..
    Thank you