How to get QTP desctiption field for all tests with a script ?
I want to get desctiption field of a test inQTP, I have a script which gets some fields from QC test plan using a vbs script
But I do not know which field this QTP description corresponds to
In QTP when your are in test setting, in the first page on left, there is the description filed (which can be populated in QTP only. on QC). I want to fetch that data to QC
Test Setting-> Properties -> Description
PS: There is also a desctiption field in QC Test Plan for every test, but these are two different fields.
You'd have to use the Automation Object Model.
The QTP test description is stored in a (binary) file called test.tsp, so it is not directly readable but it can be fetched through the Description property of an AOM Test object.
This piece of code has not been tested :
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible
qtApp.Open "C:\Tests\Test1", True ' Open the test in read-only mode
MsgBox qtApp.Test.Description ' Display test description (could be saved elsewhere...)
qtApp.Test.Close ' Close the test
qtApp.Quit ' Close QTP
Set qtApp = Nothing ' Release the Application object