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.

How to take key which defined in json data bank's custom column name box in the groovy script?

onkar
onkar Posts: 9

I want to use variable in groovy script which I have defined in json data bank's custom column name section.

Best Answer

Answers

  • onkar
    onkar Posts: 9

    Thanks @jakubiak this is very helpful and it is working as expected.

  • Poornima
    Poornima Posts: 2

    @jakubiak if xpath output contain multiple values, then how to save in list using extension tool ?

  • benken_parasoft
    benken_parasoft Posts: 1,302 ✭✭✭

    When extracting multiple values, you can use an XPath that uses the "string-join" function so you can delimit each value with a comma, for example. So, your data bank would contain a comma-separated list of the values. From your script, you can get the value of the data bank column and use the string "split" method to get the values as an array.