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.

[HELP] Script not accessing data currently stored in Data Repo

awalls
awalls Posts: 15

Hi,
I’m trying to get the existing value in my Data Repository in column soloAccountNumber to be displayed to the console. Instead of showing the value that’s already there, it always say the value is null. The goal is to check if the data repo has a value, if its null, return the the value generated from Data Generator tool, else return current value in repo.

Data Repo Current

Script Code from Data Repo CRUD tool

Console when Responder is invoked

Data Repo afterwards

Comments

  • OmarR
    OmarR Posts: 235 admin

    Good morning,

    The script's input is the location (xpath) specified for the CRUD operation. Therefore, you should just need to return the input to view the existing value in the data repository.
    Example:

    import com.parasoft.api.Application
    
    def getValue(existingValue, context) {
        Application.showMessage("DEBUG EXISTING VALUE:" + existingValue)
        return existingValue;
    }
    

    You shouldn't need to use "context.getValue" to retrieve data from the data repository. However, you will need it to retrieve data from a data bank extraction or a value generated by the Data Generator Tool. Let me know if you have any other questions!