Export UFT Datatable to ALM
Question ID: 105799
1
0

My scripts update data in my DataTable, and I want to upload those changes to ALM so other scripts can use the changed data. I can’t seem to figure out how to do that.

Marked as spam
Posted by (Questions: 386, Answers: 64)
Asked on January 15, 2015 4:42 pm
276 views
Answers (1)
1
Private answer

The below code will export your DataTable to Environment(''SystemTempDir'') which is usually C:Temp unless you've changed it, then it will upload it to an existing resource located in ALM Resources. When calling the function, you have to use the exact name of the Resource. See the screenshot.

SaveToQC(''Export_DT_2_ALM'')

Function SaveToQC(ResourceName)
'' Connection To QC
Set qcc = QCUtil.QCConnection

'' Setting Temp Folder
TempFolder = environment(''SystemTempDir'')

Set ResourceFactory = qcc.QCResourceFactory
Set ResourceList = ResourceFactory.NewList('''')
Set Resource = Nothing
iTotalItems = ResourceList.Count
For ItemCtr = 1 To iTotalItems
CurItem = ResourceList.Item(ItemCtr).Name
If UCase(CurItem) = UCase(ResourceName) Then
Set Resource = ResourceList.Item(ItemCtr)
End If
Next
Set ResourceFactory = Nothing
Set ResourceList = Nothing

'' Export Datatable to Temp Directory
Datatable.Export TempFolder & '''' & Resource.Filename

Resource.Post

Resource.UploadResource TempFolder, True
End Function

Screenshot: [ALM Resources][1]

[1]: http://screencast.com/t/kjeRzxWqH

Marked as spam
Posted by (Questions: 16, Answers: 807)
Answered on January 15, 2015 4:45 pm
0
Thats awesome, Thanks!
( at January 15, 2015 4:49 pm)
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top