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.

Extract data source value using javascript

chinnappa_raju
chinnappa_raju Posts: 4

I need to extract value of datasource column using Javascript and combine it with other values. I see some examples of Jython in the forum. Can't we achieve this using Javascript in SOATest?

Comments

  • benken_parasoft
    benken_parasoft Posts: 1,302 ✭✭✭
    edited June 2017
    function doSomething(input, context) {
       someValue = context.getValue("dataSourceName", "columnName")
    }
    

    Also see "Parasoft SOAtest User's Guide > Reference > Extensibility (Scripting) Basics"

  • chinnappa_raju
    chinnappa_raju Posts: 4

    Thanks, that worked for a datasource, but not working for a Generated Data Source like a value from Text Data Bank. I need to concatenate values from data source and random generated value - from text data bank

  • benken_parasoft
    benken_parasoft Posts: 1,302 ✭✭✭

    Use "Generated Data Source" for the data source name, the first argument in that method call. The second argument would be the data bank column name.

  • chinnappa_raju
    chinnappa_raju Posts: 4

    tried that, it doesnt work

  • OmarR
    OmarR Posts: 235 admin

    Hello Chinnappa,

    Would you kindly give us your current progress/ script so that we may evaluate it? :)