Absent Member.. Absent Member..
Absent Member..

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"
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
        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
                Set TSScheduler = Nothing
            End If
        End If
        On Error Resume Next
            'Disconnect TD session
            'Disconect and quit QTP
            If IsObject(qtApp) Then
                If qtApp.TDConnection.IsConnected Then qtApp.TDConnection.Disconnect
            End If
        On Error Goto 0
        Set qtApp = Nothing
        Set TDConnection = Nothing
    End Sub


0 Replies
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.