QCUtil Operations


' Creating QTP Application Object
Set objQTPApplication = CreateObject("QuickTest.Application")

' Launching QTP  Application
objQTPApplication.Launch

' Making QTP Application Visible
objQTPApplication.Visible = True

' Verifying QC Connecting
If Not QCUtil.IsConnected  Then

            objQTPApplication.TDConnection.Connect "http://xxxxx/qcbin/","xxxx","sasasas","bsdfsafwe","H1!dsfsdfs!ty", False
           
End If

'Geting the Current Run
Set objQCCurrentRun = QCUtil.CurrentRun
strCurrentRun = objQCCurrentRun.Name

MsgBox "Currnet Run:           "&strCurrentRun

'Geting the Current  Test
Set objQCCurrentTest = QCUtil.CurrentTest
strCurrentTest = objQCCurrentTest.Name

MsgBox "Currnet Test:           "&strCurrentTest

'Geting the Current  Test Set
Set objQCCurrentTestSet = QCUtil.CurrentTestSet
strCurrentTestSet = objQCCurrentTestSet.Name

MsgBox "Currnet TestSet:      "&strCurrentTestSet

'Geting the Current  Test Set Test
Set objQCCurrentTestSetTest = QCUtil.CurrentTestSetTest
strCurrentTestSetTest = objQCCurrentTestSetTest.Name

MsgBox "Currnet Test set Test:          "&strCurrentTestSetTest

'Geting the QC Connected Status
flgIsQCConnected = QCUtil.IsConnected
MsgBox "QC Connection Statust:      "&flgIsQCConnected

'Getting Connected Server, Project Name and Domain
If flgIsQCConnected  Then

            MsgBox "Connected Project:   "&QCUtil.QCConnection.ProjectName
            MsgBox "Connected Domain :            "&QCUtil.QCConnection.DomainName
            MsgBox "Connected Server:   "&QCUtil.QCConnection.ServerName

End If