-
Notifications
You must be signed in to change notification settings - Fork 0
/
cls_ERDS_Reporter.qfl
444 lines (424 loc) · 47.5 KB
/
cls_ERDS_Reporter.qfl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
Public intContext, intStartContext, ts, intCnt, intPass, intFail, StartTime, stTime, enTime, objIE, strFileURL, thisFSO, blnHTML, strClass, arrSteps(), iStepCount, blnDebug, iDup, strTemp
ExecuteGlobal "Dim oNativeReporter"
Set oNativeReporter = Reporter
Execute "Dim Reporter"
blnDebug = True
Set Reporter = ReporterInstance
' Disable reporting
oNativeReporter.Filter = 3
intContext = 7
Class clsReporter
' --------------------------------------------------------------------------------------------------------------------------------------------
' Initialise the class
' --------------------------------------------------------------------------------------------------------------------------------------------
Private Sub Class_Initialize
On Error Resume Next
Set thisFSO = CreateObject("Scripting.FileSystemObject")
If Not thisFSO.FolderExists("Z:\QTP\ERDS_COBAM\Reporting\" & CStr(FormatDateTime(Date, 1))) Then
thisFSO.CreateFolder "Z:\QTP\ERDS_COBAM\Reporting\" & CStr(FormatDateTime(Date, 1))
End If
If QCUtil.IsConnected = False Then
blnHTML = False
Else
blnHTML = True
End If
If blnDebug = True Then
blnHTML = True
End If
Environment("Dictionary") = CreateObject("Scripting.Dictionary")
Environment("Dictionary")("DllIconIndex") = 206
Environment("Dictionary")("DllIconSelIndex") = 206
Environment("Dictionary")("DllPAth") = "C:\Program Files\HP\QuickTest Professional\bin\ContextManager.dll"
If blnHTML Then
If blnDebug And QcUtil Is Nothing Then
OpenFile "Z:\QTP\ERDS_COBAM\Reporting\" & FormatDateTime(Date, 1) & "\" & Environment.Value("TestName") & "_Run_" & Replace(FormatDateTime(Now, 3) ,":","_") & ".html"
Else
rc = QcUtil.CurrentTestSet.Name
If Err Then
OpenFile "Z:\QTP\ERDS_COBAM\Reporting\" & FormatDateTime(Date, 1) & "\" & Environment.Value("TestName") & "_Run_" & Replace(FormatDateTime(Now, 3) ,":","_") & ".html"
Else
OpenFile "Z:\QTP\ERDS_COBAM\Reporting\" & QcUtil.CurrentTestSet.Name & "\" & QcUtil.CurrentRun.Name & "\" & QcUtil.CurrentTest.Name & ".html"
End If
End If
End If
On Error GoTo 0
End Sub
' --------------------------------------------------------------------------------------------------------------------------------------------
' Report an event
' --------------------------------------------------------------------------------------------------------------------------------------------
Public Sub ReportEvent (iStatus, strStepName, strDetails)
Dim strStatus
Dim arrSplit
' Enable reporting
oNativeReporter.Filter = 0
Environment("Dictionary")("Status") = iStatus
Environment("Dictionary")("NodeName") = strStepName
Environment("Dictionary")("StepHtmlInfo") = "<DIV align=left>" & strDetails & "</DIV>"
Environment("Dictionary")("StepInfo") = strDetails
oNativeReporter.SetContext intContext
oNativeReporter.LogEvent "User", Environment("Dictionary"), oNativeReporter.GetContext
If iStatus = 1 Or iStatus = 3 Then
clsCaptureAndAttachDesktop strStepName, strDetails, iStatus
End If
If blnHTML = True Then
ReDim Preserve arrSteps(iStepCount)
Select Case iStatus
Case 0
strStatus = "Pass"
Case 1
strStatus = "Fail"
Case 2
strStatus = "Done"
Case 3
strStatus = "Warning"
End Select
arrSteps(iStepCount) = strStepName & "|" & strDetails & "|" & strStatus
iStepCount = iStepCount + 1
End If
' Disable reporting
oNativeReporter.Filter = 3
End Sub
' --------------------------------------------------------------------------------------------------------------------------------------------
' Start Reporting node
' --------------------------------------------------------------------------------------------------------------------------------------------
Public Sub StartReporting(strStepName, strDetails)
' Enable reporting
oNativeReporter.Filter = 0
Environment("Dictionary")("Status") = 0
Environment("Dictionary")("NodeName") = strStepName
Environment("Dictionary")("StepHtmlInfo") = "<DIV align=left>" & strDetails & "</DIV>"
Environment("Dictionary")("StepInfo") = strDetails
If intContext = 7 Then
intContext = oNativeReporter.GetContext
intStartContext = intContext
Else
intContext = intStartContext
End If
oNativeReporter.SetContext intContext
intContext = oNativeReporter.LogEvent ("User", Environment("Dictionary"), oNativeReporter.GetContext)
If blnHTML = True Then
Erase arrSteps
iStepCount = 0
ReDim Preserve arrSteps(iStepCount)
arrSteps(iStepCount) = strStepName & "|" & strDetails & "|" & "Start"
iStepCount = iStepCount + 1
End If
' Disable reporting
oNativeReporter.Filter = 3
End Sub
' --------------------------------------------------------------------------------------------------------------------------------------------
' End Reporting node
' --------------------------------------------------------------------------------------------------------------------------------------------
Public Sub EndReporting()
Dim iPass, iFail, iWarning
Dim strStatus
' Enable reporting
oNativeReporter.Filter = 0
If blnHTML = True Then
On Error Resume Next
' Go through the array to see if we have any fails or warnings
For Each Ele In arrSteps
mySplit = Split(Ele, "|")
Select Case mySplit(2)
Case "Pass"
iPass = iPass + 1
Case "Fail"
iFail = iFail + 1
Case "Warning"
iWarning = iWarning + 1
Case Else
iPass = iPass + 1
End Select
Next
If iFail > 0 Then
strStatus = "Fail"
ElseIf iWarning > 0 Then
strStatus = "Warning"
Else
strStatus = "Pass"
End If
' Loop round and write out to report
For i = 0 To UBound(arrSteps)
mySplit = Split(arrSteps(i), "|")
If mySplit(2) = "Start" Then
If strTemp = "" Then
strTemp = mySplit(0)
AddNewCase mySplit(0), mySplit(1), strStatus
Else
If strTemp <> mySplit(0) Then
AddNewCase mySplit(0), mySplit(1), strStatus
Else
iDup = iDup + 1
AddNewCase mySplit(0) & iDup, mySplit(1), strStatus
strTemp = mySplit(0) & iDup
End If
End If
Else
AddNewCase "", mySplit(1), mySplit(2)
End If
Next
End If
' Disable reporting
oNativeReporter.Filter = 3
On Error GoTo 0
End Sub
' --------------------------------------------------------------------------------------------------------------------------------------------
' Report a failure and capture screenshot
' --------------------------------------------------------------------------------------------------------------------------------------------
Private Sub clsCaptureAndAttachDesktop(strImageName, strDescription, iStatus)
' Enable reporting
oNativeReporter.Filter = 0
Environment("Dictionary")("Status") = iStatus
Environment("Dictionary")("NodeName") = strImageName
Environment("Dictionary")("StepInfo") = strDetails
On Error Resume Next
' Remove invalid chars
strImageName = Replace(strImageName, "\", "")
strImageName = Replace(strImageName, "/", "")
strImageName = Replace(strImageName, "*", "")
strImageName = Replace(strImageName, "?", "")
strImageName = Replace(strImageName, """", "")
strImageName = Replace(strImageName, "<", "")
strImageName = Replace(strImageName, ">", "")
strImageName = Replace(strImageName, "|", "")
strImageName = Replace(strImageName, ":", "")
strImageName = Replace(strImageName, ";", "")
' Capture the screenshot to the report folder
rc = FormatDateTime(Time, 3)
rc = Replace(rc, ":", "")
rd = QcUtil.CurrentTestSet.Name
If Err Then
Desktop.CaptureBitmap "Z:\QTP\ERDS_COBAM\Reporting\" & FormatDateTime(Date, 1) & "\" & strImageName & rc & ".png", True
Environment("Dictionary")("StepHtmlInfo") = "<DIV align=left><img src=" & chr(34) & "Z:\QTP\ERDS_COBAM\Reporting\" & FormatDateTime(Date, 1) & "\" & strImageName & rc & ".png" & chr(34) & "/></DIV>"
Else
Desktop.CaptureBitmap "Z:\QTP\ERDS_COBAM\Reporting\" & QcUtil.CurrentTestSet.Name & "\" & QcUtil.CurrentRun.Name & "\" & strImageName & rc & ".png", True
Environment("Dictionary")("StepHtmlInfo") = "<DIV align=left><img src=" & chr(34) & "Z:\QTP\ERDS_COBAM\Reporting\" & QcUtil.CurrentTestSet.Name & "\" & QcUtil.CurrentRun.Name & "\" & strImageName & rc & ".png" & chr(34) & "/></DIV>"
End If
oNativeReporter.SetContext intContext
oNativeReporter.LogEvent "User", Environment("Dictionary"), oNativeReporter.GetContext
' QC is not connected
If QCUtil.IsConnected = False Then Exit Sub
' The test is not running from Test Lab
If QcUtil.CurrentRun Is Nothing Then Exit Sub
Set oStepsList = QCUtil.CurrentRun.StepFactory.NewList("")
iStepCount = oStepsList.Count
Set ObjCurrentTest = QCUtil.CurrentRun.StepFactory.NewList("").Item(iStepCount)
'Add the capture to QC
Set oAttachments = ObjCurrentTest.Attachments
Set oAttachment = oAttachments.AddItem(Null)
If Err Then
oAttachment.FileName = "Z:\QTP\ERDS_COBAM\Reporting\" & FormatDateTime(Date, 1) & "\" & strImageName & rc & ".png"
Else
oAttachment.FileName = "Z:\QTP\ERDS_COBAM\Reporting\" & QcUtil.CurrentTestSet.Name & "\" & QcUtil.CurrentRun.Name & "\" & strImageName & rc & ".png"
End If
oAttachment.Type = 1
oAttachment.Description = strDescription
'Add the attachment
oAttachment.Post
' Disable reporting
oNativeReporter.Filter = 3
On Error GoTo 0
End Sub
' --------------------------------------------------------------------------------------------------------------------------------------------
Private Function OpenFile(strFileName)
StartTime = Timer
stTime = Time
arrSplit = Split(strFileName, "\")
strFolder = arrSplit(0) & "\"
For i = 1 To UBound(arrSplit) -1
If thisFSO.FolderExists(strFolder & arrSplit(i)) Then
strFolder = strFolder & arrSplit(i) & "\"
Else
thisFSO.CreateFolder strFolder & arrSplit(i)
strFolder = strFolder & arrSplit(i) & "\"
End If
Next
Set ts = thisFSO.OpenTextFile(strFileName, 2, True)
strFileURL = strFileName
CreateHeader
End Function
' --------------------------------------------------------------------------------------------------------------------------------------------
Private Function CreateHeader()
ts.Writeline("<html>")
ts.Writeline("<script language='javascript'>")
ts.Writeline("function run(a) {")
ts.Writeline("tr = document.getElementsByTagName('tr');")
ts.Writeline("for (var i = 0; i < tr.length; i++)")
ts.Writeline("{ if (tr[i].className == a)")
ts.Writeline("if (!tr[i].style.display)")
ts.Writeline("tr[i].style.display = 'none';")
ts.Writeline("else tr[i].style.display = ''; } } </script>")
ts.Writeline("<title>Test Results</title>")
If blnDebug And QcUtil Is Nothing Then
ts.WriteLine("<head><img border=0 src=" & Chr(34) & "../images/logo_branding.gif" & Chr(34) & "></head>")
Else
On Error Resume Next
rc = QcUtil.CurrentTestSet.Name
If Err Then
ts.WriteLine("<head><img border=0 src=" & Chr(34) & "../images/logo_branding.gif" & Chr(34) & "></head>")
Else
ts.WriteLine("<head><img border=0 src=" & Chr(34) & "../../images/logo_branding.gif" & Chr(34) & "></head>")
End If
On Error Goto 0
End If
ts.WriteLine("<body>")
ts.WriteLine("<font face='Tahoma' size='2'>")
ts.Writeline("<table border='0' width='100%' height='47'>")
ts.Writeline("<tr>")
ts.Writeline("<td width='35%' bgcolor='#CCCCFF' align='center'><b><font color='#000000' face='Tahoma' size=-1>Test Step</font></b></td>")
ts.Writeline("<td width='45%' bgcolor='#CCCCFF'><b><font color='#000000' face='Tahoma' size=-1>Description</font></b></td>")
ts.Writeline("<td width='20%' bgcolor='#CCCCFF' align='center'><b><font color='#000000' face='Tahoma' size=-1>Pass/Fail</font></b></td>")
ts.Writeline("</tr>")
End Function
' --------------------------------------------------------------------------------------------------------------------------------------------
Private Function AddNewCase(strTCID, strDescription, strPassFail)
On Error Resume Next
If strTCID <> "" Then
ts.Writeline("<tr bgcolor='#FFDCFF' >")
Select Case strPassFail
Case "Pass"
If blnDebug And QcUtil Is Nothing Then
ts.Writeline("<td width='35%' valign='middle' align='left><a href=#' onclick=" & Chr(34) & "run('" & strTCID & "');" & Chr(34) & "><img border=0 src=" & Chr(34) & "..\images\plus.gif" & Chr(34) & "></a><font size=-1 color='Green' face='Tahoma'>" & strTCID & "</font></td>")
Else
rc = QcUtil.CurrentTestSet.Name
If Err Then
ts.Writeline("<td width='35%' valign='middle' align='left><a href=#' onclick=" & Chr(34) & "run('" & strTCID & "');" & Chr(34) & "><img border=0 src=" & Chr(34) & "..\images\plus.gif" & Chr(34) & "></a><font size=-1 color='Green' face='Tahoma'>" & strTCID & "</font></td>")
Else
ts.Writeline("<td width='35%' valign='middle' align='left><a href=#' onclick=" & Chr(34) & "run('" & strTCID & "');" & Chr(34) & "><img border=0 src=" & Chr(34) & "..\..\images\plus.gif" & Chr(34) & "></a><font size=-1 color='Green' face='Tahoma'>" & strTCID & "</font></td>")
End If
End If
strClass = strTCID
ts.Writeline("<td width='45%' valign='top' align='justify'><font size=-1>" & strDescription & "</font></td>")
ts.Writeline("<td width='20%' valign='middle' align='center'><b><font color='Green' face='Tahoma' size=-1>" & strPassFail & "</font></b></td>")
Case "Fail"
If blnDebug And QcUtil Is Nothing Then
ts.Writeline("<td width='35%' valign='middle' align='left'><a href=#' onclick=" & Chr(34) & "run('" & strTCID & "');" & Chr(34) & "><img border=0 src=" & Chr(34) & "..\images\plus.gif" & Chr(34) & "></a><b><font size=-1 color='Red' face='Tahoma'>" & strTCID & "</font><b></td>")
Else
rc = QcUtil.CurrentTestSet.Name
If Err Then
ts.Writeline("<td width='35%' valign='middle' align='left'><a href=#' onclick=" & Chr(34) & "run('" & strTCID & "');" & Chr(34) & "><img border=0 src=" & Chr(34) & "..\images\plus.gif" & Chr(34) & "></a><b><font size=-1 color='Red' face='Tahoma'>" & strTCID & "</font><b></td>")
Else
ts.Writeline("<td width='35%' valign='middle' align='left'><a href=#' onclick=" & Chr(34) & "run('" & strTCID & "');" & Chr(34) & "><img border=0 src=" & Chr(34) & "..\..\images\plus.gif" & Chr(34) & "></a><b><font size=-1 color='Red' face='Tahoma'>" & strTCID & "</font><b></td>")
End If
End If
strClass = strTCID
ts.Writeline("<td width='45%' valign='top' align='justify'><b><font color='Red' face='Tahoma' size=-1>" & strDescription & "</font></b></td>")
ts.Writeline("<td width='20%' valign='middle' align='center'><b><font color='Red' face='Tahoma' size=-1>" & strPassFail & "</font></b></td>")
Case "Warning"
If blnDebug And QcUtil Is Nothing Then
ts.Writeline("<td width='35%' valign='middle' align='left'><a href=#' onclick=" & Chr(34) & "run('" & strTCID & "');" & Chr(34) & "><img border=0 src=" & Chr(34) & "..\images\plus.gif" & Chr(34) & "></a><b><font size=-1 color='Orange' face='Tahoma'>" & strTCID & "</font></b></td>")
Else
rc = QcUtil.CurrentTestSet.Name
If Err Then
ts.Writeline("<td width='35%' valign='middle' align='left'><a href=#' onclick=" & Chr(34) & "run('" & strTCID & "');" & Chr(34) & "><img border=0 src=" & Chr(34) & "..\images\plus.gif" & Chr(34) & "></a><b><font size=-1 color='Orange' face='Tahoma'>" & strTCID & "</font></b></td>")
Else
ts.Writeline("<td width='35%' valign='middle' align='left'><a href=#' onclick=" & Chr(34) & "run('" & strTCID & "');" & Chr(34) & "><img border=0 src=" & Chr(34) & "..\..\images\plus.gif" & Chr(34) & "></a><b><font size=-1 color='Orange' face='Tahoma'>" & strTCID & "</font></b></td>")
End If
End If
strClass = strTCID
ts.Writeline("<td width='45%' valign='top' align='justify'><b><font color='Orange' face='Tahoma' size=-1>" & strDescription & "</font></b></td>")
ts.Writeline("<td width='20%' valign='middle' align='center'><b><font color='Orange' face='Tahoma' size=-1>" & strPassFail & "</font></b></td>")
Case Else
If blnDebug And QcUtil Is Nothing Then
ts.Writeline("<td width='35%' valign='middle' align='left'><a href=#' onclick=" & Chr(34) & "run('" & strTCID & "');" & Chr(34) & "><img border=0 src=" & Chr(34) & "..\images\plus.gif" & Chr(34) & "></a><font size=-1 color='Blue' face='Tahoma'>" & strTCID & "</font></td>")
Else
rc = QcUtil.CurrentTestSet.Name
If Err Then
ts.Writeline("<td width='35%' valign='middle' align='left'><a href=#' onclick=" & Chr(34) & "run('" & strTCID & "');" & Chr(34) & "><img border=0 src=" & Chr(34) & "..\images\plus.gif" & Chr(34) & "></a><font size=-1 color='Blue' face='Tahoma'>" & strTCID & "</font></td>")
Else
ts.Writeline("<td width='35%' valign='middle' align='left'><a href=#' onclick=" & Chr(34) & "run('" & strTCID & "');" & Chr(34) & "><img border=0 src=" & Chr(34) & "..\..\images\plus.gif" & Chr(34) & "></a><font size=-1 color='Blue' face='Tahoma'>" & strTCID & "</font></td>")
End If
End If
strClass = strTCID
ts.Writeline("<td width='45%' valign='top' align='justify'><font size=-1>" & strDescription & "</font></td>")
ts.Writeline("<td width='20%' valign='middle' align='center'><b><font color='Blue' face='Tahoma' size=-1>" & strPassFail & "</font></b></td>")
End Select
Else
ts.Writeline("<tr class='" & strClass & "' style='display:none'>")
Select Case strPassFail
Case "Pass"
ts.Writeline("<td width='35%' bgcolor='#FFFFDC' valign='middle' align='center'><font size=-1>" & strTCID & "</font></td>")
ts.Writeline("<td width='45%' bgcolor='#FFFFDC' valign='top' align='justify'><font size=-1>" & strDescription & "<font></td>")
ts.Writeline("<td width='20%' bgcolor='#FFFFDC' valign='middle' align='center'><b><font color='Green' face='Tahoma' size=-1>" & strPassFail & "</font></b></td>")
intPass = intPass + 1
Case "Fail"
ts.Writeline("<td width='35%' bgcolor='#FFFFDC' valign='middle' align='center'><b><font size=-1 color='Red'>" & strTCID & "</font></b></td>")
ts.Writeline("<td width='45%' bgcolor='#FFFFDC' valign='top' align='justify'><b><font size=-1 color='Red'>" & strDescription & "</font></b></td>")
ts.Writeline("<td width='20%' bgcolor='#FFFFDC' valign='middle' align='center'><a href='" & ".\" & strObjective & ".png' target='_blank' ><b><font size=-1 color='Red'>" & strPassFail & "</font></b></a></td>")
intFail = intFail + 1
Case "Warning"
ts.Writeline("<td width='35%' bgcolor='#FFFFDC' valign='middle' align='center'><b><font size=-1 color='Orange'>" & strTCID & "</font></b></td>")
ts.Writeline("<td width='45%' bgcolor='#FFFFDC' valign='top' align='justify'><b><font size=-1 color='Orange'>" & strDescription & "</font></b></td>")
ts.Writeline("<td width='20%' bgcolor='#FFFFDC' valign='middle' align='center'><b><font size=-1 color='Orange' face='Tahoma' size='2'>" & strPassFail & "</font></b></td>")
Case Else
ts.Writeline("<td width='35%' bgcolor='#FFFFDC' valign='middle' align='center'><font size=-1>" & strTCID & "</font></td>")
ts.Writeline("<td width='45%' bgcolor='#FFFFDC' valign='top' align='justify'><font size=-1>" & strDescription & "</font></td>")
ts.Writeline("<td width='20%' bgcolor='#FFFFDC' valign='middle' align='center'><b><font size=-1 color='Blue' face='Tahoma' size='2'>" & strPassFail & "</font></b></td>")
End Select
End If
ts.Writeline("</tr>")
On Error GoTo 0
End Function
' --------------------------------------------------------------------------------------------------------------------------------------------
Private Function Footer()
Dim EndTime
On Error Resume Next
EndTime = Timer
enTime = Time
ts.Writeline("</table>")
ts.Writeline("<hr>")
ts.Writeline("<table border='0' width='50%'>")
ts.Writeline("<tr><td width='100%' colspan='2' bgcolor='#000000'><b><font face='Tahoma' size=-1 color='#FFFFFF'>Summary</font></b></td></tr>")
ts.Writeline("<tr><td width='45%' bgcolor='#E8FFE8'><b><font face='Tahoma' size=-1>Total Tests Passed</font></b></td><td width='55%' bgcolor='#E8FFE8' <font face='Tahoma' size=-1>" & intPass & "</font></td></tr>")
ts.Writeline("<tr><td width='45%' bgcolor='#FFE6FF'><b><font face='Tahoma' size=-1>Total Tests Failed</font></b></td><td width='55%' bgcolor='#FFE6FF' <font face='Tahoma' size=-1>" & intFail & "</font></td></tr>")
ts.Writeline("<tr><td width='45%' bgcolor='#FFFFDC'><b><font face='Tahoma' size=-1>Executed On</font></b></td><td width='55%' bgcolor= '#FFFFDC' <font face='Tahoma' size=-1>" & Date & "</font></td></tr>")
ts.Writeline("<tr><td width='45%' bgcolor='#FFFFDC'><b><font face='Tahoma' size=-1>Start Time</font></b></td><td width='55%' bgcolor= '#FFFFDC' <font face='Tahoma' size=-1>" & stTime & "</font></td></tr>")
ts.Writeline("<tr><td width='45%' bgcolor='#FFFFDC'><b><font face='Tahoma' size=-1>End Time</font></b></td><td width='55%' bgcolor= '#FFFFDC' <font face='Tahoma' size=-1>" & enTime & "</font></td></tr>")
ts.Writeline("<tr><td width='45%' bgcolor='#FFFFDC'><b><font face='Tahoma' size=-1>Execution Time</font></b></td><td width='55%' bgcolor= '#FFFFDC' <font face='Tahoma' size=-1>" & CDbl(EndTime - StartTime) & "</font></td></tr>")
If blnDebug And QcUtil Is Nothing Then
ts.WriteLine("<tr><td width='45%' bgcolor='#FFFFDC'><b><font face='Tahoma' size=-1>Test Name</font></b></td><td width='55%' bgcolor= '#FFFFDC' <font face='Tahoma' size=-1>" & Environment("TestName") & "</font></td></tr>")
Else
rc = QcUtil.CurrentTestSet.Name
If Err Then
ts.WriteLine("<tr><td width='45%' bgcolor='#FFFFDC'><b><font face='Tahoma' size=-1>Test Name</font></b></td><td width='55%' bgcolor= '#FFFFDC' <font face='Tahoma' size=-1>" & Environment("TestName") & "</font></td></tr>")
Else
ts.WriteLine("<tr><td width='45%' bgcolor='#FFFFDC'><b><font face='Tahoma' size=-1>Test Name</font></b></td><td width='55%' bgcolor= '#FFFFDC' <font face='Tahoma' size=-1>" & QcUtil.CurrentTest.Name & "</font></td></tr>")
ts.WriteLine("<tr><td width='45%' bgcolor='#FFFFDC'><b><font face='Tahoma' size=-1>Test Set Name</font></b></td><td width='55%' bgcolor= '#FFFFDC' <font face='Tahoma' size=-1>" & QcUtil.CurrentTestSet.Name & "</font></td></tr>")
ts.WriteLine("<tr><td width='45%' bgcolor='#FFFFDC'><b><font face='Tahoma' size=-1>Run Name</font></b></td><td width='55%' bgcolor= '#FFFFDC' <font face='Tahoma' size=-1>" & QcUtil.CurrentRun.Name & "</font></td></tr>")
End If
End If
ts.Writeline("</table>")
ts.Writeline("</font>")
ts.WriteLine("</body>")
ts.WriteLine("</html>")
On Error GoTo 0
End Function
' --------------------------------------------------------------------------------------------------------------------------------------------
Private Function CloseFile()
Footer
ts.Close()
Set thisFSO = Nothing
End Function
' --------------------------------------------------------------------------------------------------------------------------------------------
Private Sub Class_Terminate()
If blnHTML = True Then
ts.Close
Set ts = thisFSO.OpenTextFile(strFileURL, 1)
strContents = ts.ReadAll
ts.Close
Set ts = thisFSO.OpenTextFile(strFileURL, 8)
On Error Resume Next
mySplit = Split(arrSteps(0), "|")
If Instr(1, strContents, mySplit(0) ) Then
CloseFile()
Else
Reporter.EndReporting "End of Test Report", "Testing Ended"
CloseFile
End If
End If
Set oNativeReporter = Nothing
End Sub
End Class
Public Function ReporterInstance()
Set ReporterInstance = New clsReporter
End Function