Extract data source value using javascript

Options
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,392 ✭✭✭
    edited June 2017
    Options
    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 ✭
    Options

    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,392 ✭✭✭
    Options

    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 ✭
    Options

    tried that, it doesnt work

  • [Deleted User]
    [Deleted User] Posts: 0 admin
    Options

    Hello Chinnappa,

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