Brandy
Brandy

Reputation: 175

UFT OTA - Get ID of copied test set folder

I have (after FOREVER) figured out how to copy a test set folder from one location to another and rename it using a explicit folder id. Now, I want to rename the new folder right after pasting, so the id will NOT be known. I have found absolutely NOTHING on how I can do this.

I'm trying my hardest to use the online resource for OTA, but it's really unhelpful unless you already know the language. I can't seem to find what I need, so please don't suggest that.

Thanks in advance. Currently very frustrated and ready to throw out my computer.

Here's what I have to copy, paste, and rename a specific node by id

Set qcConnection = QCutil.QCConnection

copiedTestSet = qcConnection.TestSetTreeManager.CopyToClipboard(3)
QCConnection.TestSetFactory.PasteFromClipboard copiedTestSet,6,2,1


Set renameTest = qcconnection.TestSetTreeManager.NodeByID(30)
print renameTest.Name
renameTest.Name = "Rename Test"
renameTest.Post

Set renameTest = Nothing
Set copiedTestSet = Nothing

Upvotes: 0

Views: 222

Answers (2)

Brandy
Brandy

Reputation: 175

I was able to find what I needed using sumeet's suggestion above. My exact code is below using variables because I need to be able to run this with any folder. It runs right after the paste command above. I had to insert a wait after pasting for some reason, but it works for now. I'll trouble shoot that later

Set renameTest = qcconnection.TestSetTreeManager.NodeByPath(strPath & "\" & strEventFolder)

Upvotes: 0

sumeet singh kushwah
sumeet singh kushwah

Reputation: 188

You will know the folder name of the pasted folder, because it should be same as the copied folder, you can simple search for the pasted folder with name under the parent folder.

Below page have few functions which can help you

https://github.com/sumeet-kushwah/ALM_OTA_Wrapper/blob/master/ALM_Wrapper/TestLabFolders.cs

There are three functions you should search for

FindChildFolderByName

FindChildFolders

GetTestSetFolder

Upvotes: 1

Related Questions