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.
Answer by Michaeldx · Jan 15, 2015 at 04:45 PM
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