Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Highlighted
raju_aus Contributor.
Contributor.
110 views

UFT API test - Write values to datatable and export to ALM

Hi All

I have using UFT for an API test. from the json response i get i am able to parse the response and store some data from response to output parameters. But now I have to write these parameter values to the input datasheet and upload back to ALM.

Also the api test is set up to run for each row in the input datasheet.

did anyone tried to write parameter values to datatable? If so can you please assist.

regards

0 Likes
2 Replies
Respected Contributor.. Trimper Respected Contributor..
Respected Contributor..

Re: UFT API test - Write values to datatable and export to ALM

I don't use it often, but you can do this:
GetDataSource("Test sheet!Sheet1").SetValue(Loop2.CurrentIterationNumber - 1, "MemberName", "Joe");

Where:
Test sheet!Sheet1 - is the name of your data sheet (you can cheat and right click the sheet in the data tab, and copy name)
MemberName - is the column you want to update
For this silly example I set all the values to 'Joe'

Also, note that the rows start at 0, so if you were to use a loop, subtract 1...

hope this helps.
0 Likes
Contributor.. andreipaun1 Contributor..
Contributor..

Re: UFT API test - Write values to datatable and export to ALM

Use newtonsoft.dll to deserialize the json if you need help let me know https://www.newtonsoft.com/json

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.