Hello Friends,
This article is basically an extension to my previous article How to Connect to HP QC using Excel VBA. As we know, from the previous article that QC Connection is made in two parts:
1. Authentication using QC ID and Password
2. Login with Domain and Project Name
It is a good practice to check the Connection Object – qcConnection whether Authentication and Login with Domain and Project were successful before using it.
VBA Statement to check if Authentication was Successful ?
If (QCConnection.LoggedIn <> True) Then
MsgBox "QC User Authentication Failed"
End If
VBA Statement to check if Login with Domain and Project was Successful ?
If (QCConnection.AuthenticationToken = "") Then
MsgBox "QC Project Failed to Login with your Domain and Project"
QCConnection.Disconnect
End If
Refer the below VBA code to connect to QC with both the checks done
Function ConnectToQC()
On Error Resume Next
Dim QCConnection
'Create QC Connection Object to connect to QC
Set QCConnection = CreateObject("TDApiOle80.TDConnection")
Dim sUserName, sPassword, sDomain, sProject
sUserName = ""
sPassword = ""
sDomain = ""
sProject = ""
QCConnection.InitConnectionEx "<you URL>"
'Authenticate your user ID and Password
QCConnection.Login sUserName, sPassword
'Quit if QC Authentication fails
If (QCConnection.LoggedIn <> True) Then
MsgBox "QC User Authentication Failed"
End
End If
'Login to your Domain and Project
QCConnection.Connect sDomain, sProject
'Quit if login fails to specified Domain and Project
If (QCConnection.AuthenticationToken = "") Then
MsgBox "QC Project Failed to Connect to " & sProject
QCConnection.Disconnect
End
End If
Hi,
I am getting below error, when i am trying to login with HP QC.
“QC User Authintication Failed”
Hi ,
I am also “QC User Authentication failed” while trying to log in HP ALM.
Please reply , how can I get rid of this…
Thanks in Advance…
“QCConnection” always returns empty and QC user Authentication Failed. 🙁
I am getting the below error:
“QC User Authintication Failed”
Try logging into ALM (via Internet Explorer or QC Explorer) and then installing both “HP Quality Center Connectivity” and “HP ALM Client Registration” Add-Ins from the Help Menu.
Once complete, try the script again.