How to set a value of a variable in data source using groovy script
Hi, I have written a groovy script in which I am capturing a path which I want to get set in the data source, so that I can use that path dynamically in my write file.
Comments
-
Good morning SrivaS5,
You could use the following line in your script to set a Test Suite variable:
context.setValue("Variable_Name", "New_Value")I recommend taking at look at @Ramiro Martinez's comment in the following link for reference:
https://forums.parasoft.com/discussion/comment/8345#Comment_83450 -
For more information, take a look at our online documentation https://docs.parasoft.com/pages/viewpage.action?pageId=17171111#ConfiguringTestSuiteProperties-TestFlowLogic,Variables,etc.-SettingVariablesandLogicThroughScripting
0 -
Srivas, did you see my previous answer to this question? You can store values in either data bank columns, writable data source columns, or test variables, depending on your preference.
0 -
Thankyou all for the various solutions
0 -
How to get name of DataSource using Java code / Groovy Scripting?
0 -
How to get name of DataSource using Java code / Groovy Scripting?
From the scripting API, you reference things by their name. A test suite can have multiple data sources. You need to know the name of the data source you want to work with. Or perhaps you can set a test suite variable called "dataSourceName", set that to the name of the data source you want, then lookup that variable from your script.
0