Create Datasource columns and values via groovy
I am trying to copy contents from a datasource/datasink of one testcase to a brand new grid datasource in another testcase.
Following is the scenario:
I am testing 2 features - Login and FunctionX using 2 testcases.
Login testcase (LoginTC) has 2 inputs (username and password) that I am storing in datasource (USERS). There are about 100 entries in USERS. After login webrequest is called, I store the authentication token along with username in a datasink (DS) in the testcase.
My next testcase for FunctionX (XTC) takes 2 inputs (username and authentication token) stored in a datasource (AuthedUsers).
Is there a way in groovy by which I can copy contents from datasink DS of LoginTC to datasource AuthedUsers in XTC ?
NOTE: I am using the SoapUI NG Pro.
Hi Diganth,
Thank you for your post!
You can get a Datasink content using the following:
context.expand( '${DataSink_TestStep_Name#Property_Name}' )
What is the type of your DataSource and DataSink? Maybe it's better to use the Property expansion: https://support.smartbear.com/readyapi/docs/testing/properties/expansion.html or the Property Transfer Test Step: https://support.smartbear.com/readyapi/docs/soapui/steps/property-transfer.html.