VBScrip using TDCONNECTION.SENDMAIL (API OTA) are having some problems
Hello, we are using a vbscript using API OTA for TestSets execution and mail sending after the run completes.
The problem is that the script are having intermittent problems because sometimes works fine but many times don't send the email with test results. The script is using the tdconnection.sendmail function and we are using two runtime machines: one is phisical and with an UFT full license and other is a VM with a UFT runtime license only. Is in the second machine that we are having the problems because in the first one (phisical with UFT full license) the script is allways sending emails.
Can anybody gives us a clue about what is happening?
Thanks in advance.
Here is the part of the script we are using:
Dim Server, UserName, Password, QCDomain, QCProject, QCTestSetPath, QCTestSetName
Server = "http://almhost.victoria.portugal:8080/qcbin/"
UserName = "Controlo_Qualidade"
Password = "password"
QCDomain = "AUTOMAÇÃO"
QCProject = "AUTOMACAO_TESTES"
QCTestSetPath = "Root\Testes_NPA"
QCTestSetName = "TS-Valida_Login_NPA"
''' Sends an email to the distribution list
Private Sub TDSendMail()
Dim EMailTo : EMailTo = Me.EMailTo
Dim QCTestSetName : QCTestSetName = Me.QCTestSetName
If EMailTo = "" Then Exit Sub
TDConnection.SendMail EMailTo, "", "Test Execution: " & QCTestSetName, sHTML
'Class Initialize & Terminate
''' Releases connections and sends mail after TSScheduler execution
Private Sub Class_Terminate()
If IsObject(TSScheduler) Then
If Not TSScheduler Is Nothing Then
TSFolder.Refresh : WScript.Sleep(5000)
'Send an email to the distribution list
Set TSScheduler = Nothing
On Error Resume Next
'Disconnect TD session
'Disconect and quit QTP
If IsObject(qtApp) Then
If qtApp.TDConnection.IsConnected Then qtApp.TDConnection.Disconnect
On Error Goto 0
Set qtApp = Nothing
Set TDConnection = Nothing