Labels

Thursday, April 11, 2013

How to customize auto email when test script status changes.

Place below code in the Test Plan Module and call  'Test_FieldChange' function in 'Test_MoveTo'

Sub Test_FieldChange(FieldName)
On Error Resume Next
Dim strSubject, strComment
If FieldName = "TS_STATUS" Then
strSubject = "Test Change Notification" & _
" for project " & TDConnection.ProjectName & _
" in domain " & TDConnection.DomainName
strComment = "The user " & User.FullName & _
" changed the status of the test " & _
Test_Fields("TS_NAME").Value & _
" to " & Test_Fields("TS_STATUS").Value
SendTest Test_Fields("TS_TEST_ID").Value, _
Test_Fields("TS_RESPONSIBLE").Value, "[QA Testers]", _
strSubject, StrComment
End If
End Sub

Sub SendTest (iObjectId, strTo, strCc, strSubject, strComment)
On Error Resume Next
Dim objTestFactory, objTest
Set objTestFactory = TDConnection.TestFactory
Set objTest = objTestFactory.Item(iObjectId)
objTest.Mail strTo, strCc, 2, strSubject, strComment
Set objTest = Nothing
Set objTestFactory = Nothing
PrintError "SendTest"
On Error GoTo 0
End Sub

No comments:

Post a Comment