

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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:
'VBScript Document
Option Explicit
'QC Paramters
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"
......................
''' <summary>
''' Sends an email to the distribution list
''' </summary>
''' <remarks></remarks>
Private Sub TDSendMail()
Dim EMailTo : EMailTo = Me.EMailTo
Dim QCTestSetName : QCTestSetName = Me.QCTestSetName
If EMailTo = "" Then Exit Sub
load_ExecutionRunStatus()
TDConnection.SendMail EMailTo, "", "Test Execution: " & QCTestSetName, sHTML
End Sub
----------------------
'Class Initialize & Terminate
''' <summary>
''' Releases connections and sends mail after TSScheduler execution
''' </summary>
''' <remarks></remarks>
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
TDSendMail()
Set TSScheduler = Nothing
End If
End If
On Error Resume Next
'Disconnect TD session
TDConnection.Disconnect
'Disconect and quit QTP
If IsObject(qtApp) Then
If qtApp.TDConnection.IsConnected Then qtApp.TDConnection.Disconnect
qtApp.Quit
End If
On Error Goto 0
Set qtApp = Nothing
Set TDConnection = Nothing
End Sub