Header Ads

QTP QC Connection

Those automation engineers who generally work with QC/TD and QTP.They need to check for active QTP-QC connection.
Here is a simple code to determine if the connection is active or not or to connect the QTP and QC

Set qtApp = CreateObject("QuickTest.Application")
If qtApp.TDConnection.IsConnected Then
msgbox "QC"
Else
msgbox "Local"
End If

(or)

if QCUtil.IsConnected then
Reporter.ReportEvent 0, "Connected", "Connected to server: " + QCUtil.QCConnection.ServerName + chr (13) +"Project: " +
QCUtil.QCConnection.ProjectName + chr (13) + "Domain: " + QCUtil.QCConnection.DomainName
else
Reporter.ReportEvent 1, "Not connected", "Not connected to Quality Center"
end if
Powered by Blogger.