Create a new resource in ALM/QC using the Open Test Architecture API. First a new resource is created then file is attached to that resource. The below sub accepts 4 parameters. This sub uses a TDConnection object. Create it before using the below code.
Parameter Info -
Quickly set up Amazon ELB(Elastic Load Balancing)
Amazon Web Services provides the facility of balancing and distributing the traffic equally on all the instances through ELB.Many instances are connected in ELB with one route.
Go To AWS Console.
Click on Load Balancer.
Define Load Balancer
1). Click on “Create Load Balancer” in AWS Console.
2.a). Write the Load Balancer name.
2.b). EC2-Classic — Instances launched in EC2-Classic run in a flat network that you share with other customers.
EC2-VPC — Instances launched in EC2-VPC run in an virtual private cloud (VPC) that is logically isolated in your AWS account.
2.c). Listener configuration:Enter the port you want to pass through your listener.
Select EC2 .
Click On CONTINUE.
Function CreateFolderInTestPlan(FolderName As String)
Dim TreeMgr As TreeManager
Set newFolder = Nothing
'Create a treemanager object for accessing test plan tree hierarchy
Set TreeMgr = TDConn.TreeManager
'Set rootFolder to subject node of test plan in alm
Set rootFolder = TreeMgr.NodeByPath("Subject")
'Check if folder exists
Set newFolder = rootFolder.FindChildNode(FolderName )
'If doesnt exists then create
If newFolder Is Nothing Then
Set newFolder = rootFolder.AddNode(FolderName )
This function lets you create a new folder under test plan. TDConn is the TDConnection object. Make sure ALM connection has been created. Create a error handler if you need.
'Create a TDConnection Object,TreeManager Object
Set UploadFolder = TreeMgr.NodeByPath(ALM_Upload_Folder)
Set tstAttachmentFactory = UploadFolder.Attachments
'Null refers to reserving space for a attachment
Set fileToUpload = tstAttachmentFactory.AddItem(Null)
'Provide full path of the file to attach
fileToUpload.Filename = "C:\Projects\Automation\abc.qfl"
'Add a description to the attachment
fileToUpload.Description = "via Script"
'Add below line to avoid file upload with 0KB size,Specify type = 1(any file)
fileToUpload.Type = 1
'Finally attaches the file to specified node
That’s it. If you miss the type you will end up with uploading file with 0kb.
In case of any issue or error still persists,leave a comment below.