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.

Unable to retrieve values which are in XML data bank in extension tool

Options

I am storing the DB tool output to the XML data bank.
In other test (where i am using Extension tool) i am trying to retrieve the value using the below code. but it's returning NULL.

import com.parasost.api;

public void getData(input,sc){
String value =sc.getValue("Custom column name");
Application.showMessage("The value is: "+value);
}

Comments

  • benken_parasoft
    benken_parasoft Posts: 1,235 ✭✭✭
    edited March 2022
    Options

    String value =sc.getValue("Custom column name");

    This is how you access a test variable, not a data source or data bank column. Data Banks belong to a data source named "Generated Data Source." Do this instead:

    String value = sc.getValue("Generated Data Source", "Custom column name")

    See String Operations Using Extracted Values

  • YeswanthRatakonda
    Options

    Hi Benken,

    I have tried this but still getting Null.

    String value = sc.getValue("Generated Data Source","Custom column nmae");

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

    I have tried this but still getting Null.

    This will work if the Data Bank column was written to. If the XPath in your Data Bank did not match anything then nothing will be written to the column. Also make sure that for "Custom column name" you are actually using the real name of the custom column that was configured in the extraction in your Data Bank.