How to take values from xml or json data banks into groovy scripts.
Im trying to take the values from data bank into script but getting error can anyone help me out.
Answers
-
Hi Navsid,
what error do you see?
Usually it should be straight forward like is described in User Manual
See section Accessing Data Sources from Scripts.
You can find a couple examples on this forum--
Ireneusz Szmigiel
http://www.catb.org/esr/faqs/smart-questions.html0 -
Hi how to take key from xml and json data banks into groovy scripts. And perfrom operations on that values and need to pass a specific value to next test.
0 -
In the script, the method needs to define the context object, and then it needs to call getValue() on that context like in the following example, where "dataBankColumnName" is the name of the data bank column you defined:
import com.parasoft.api.*; public void doSomething(Context context) { context.getValue("Generated Data Source", "dataBankColumnName") }
I just typed up this example quickly without testing it, so it may take some tweaks to make it work if I have a typo.
0