How to add Test ID to Test Instance in Test Set

Posted: March 16, 2014 in Uncategorized

Sub CopyTestIDs
On Error Resume Next
Dim TestSetFact
Dim TSTestFact
Dim theTestSet
Dim theTSTest
Dim TestSetTestsList
Set tdc= TDConnection
Set TestSetFact = TestSetFactory     ‘ TEST SET FACTORY CONTAINS ALL THE TEST SETS
Set TSTestFact = TSTestFactory       ‘ CONTAINS ALL THE TEST INSTANCES OF A TEST SET
Set theTestSet = TestSet             ‘ TEST SET IS ONE OF THE MEMBER IN TEST SET FACTORY
Set theTSTest = TSTest               ‘ INSTANCE IS ONE OF THE TEST INSTANCES IN  TSTestFactory
Set TestSetTestsList = list
‘ Get the TestSetFactory object
Set TestSetFact = tdc.TestSetFactory
‘ Get the current Test Set by the Test Set ID
Set theTestSet = TestSetFact.Item(TestSet_Fields(“CY_CYCLE_ID”).Value)
‘ Get the TSTest factory and list of TSTests
Set TSTestFact = theTestSet.TSTestFactory ‘ Get the list of all the test cases present in the Test Set
Set TestSetTestsList = TSTestFact.NewList(“”)’ Copy the test case id from Test Plan into the Test ID field in every Test Instance
For Each theTSTest In TestSetTestsList
theTSTest.Field(“TC_USER_01”) = theTSTest.TestId ‘ TC_USER_10 is the Test Instance user created field called Test ID to hold the ids from test plan
Next
On Error GoTo 0
End Sub
Sub TestSetTests_MoveTo
On Error Resume Next
Call CopyTestIDs
On Error GoTo 0
End Sub

 

Test Instance Custom Field

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s