Want to store data in variable fetching from XML databank in javascript for custom assertion

AnushreeAnushree Posts: 1

Want to store data in variable fetching from XML databank in javascript for custom assertion. Can you please help me?
For example, In XML data bank I have extracted an element named "Date"
In Custom script, I want to store this element in a variable. What should be the syntax?

Answers

  • OmarROmarR Posts: 204 admin

    Good morning,

    You can access your databank variables using a special data source name: "Generated Data Source". For example:
    var = context.getValue("Generated Data Source", "columnName")

    The "columnName" here would be the column name in the XML Data Bank.

    Similarly, to access values from a table or an excel data source, you could simply use the name given to the data source. For example:
    var = context.getValue("myTable", "columnName")
    The "columnName" here would be the column name in the Table-datasource called "myTable".

    See AccessingDataSourcesfromScripts for more info.

Sign In or Register to comment.