Creating Custom Report File
(Reference: CreateXML)
(See Previous Blog)
'*******************************************************************************************************************************************
'* Function : createCustomReportFile
'*******************************************************************************************************************************************
Function createCustomReportFile(ByVAL Desc)
Desc = Desc & "->" & Now
'Initializing the file system object
Set objFile = createobject("Scripting.FileSystemObject")
On Error Resume Next
If objFile.FileExists(Environment.Value("REPORT_NAME")) Then
Set customReport = XMLUtil.CreateXML()
customReport.LoadFile Environment.Value("REPORT_NAME")
Set root = customReport.GetRootElement()
Set TestSuite=root.ChildElements().Item(1)
Else
Call CreateXML()
Set root = customReport.GetRootElement()
root.AddChildElementByName "TestSuite",Desc
Set TestSuite=root.ChildElements().Item(1)
TestSuite.AddAttribute "startTime" ,cstr(Now)
TestSuite.AddAttribute "Desc", Desc
End If
End Function
(Reference: CreateXML)
(See Previous Blog)
'*******************************************************************************************************************************************
'* Function : createCustomReportFile
'*******************************************************************************************************************************************
Function createCustomReportFile(ByVAL Desc)
Desc = Desc & "->" & Now
'Initializing the file system object
Set objFile = createobject("Scripting.FileSystemObject")
On Error Resume Next
If objFile.FileExists(Environment.Value("REPORT_NAME")) Then
Set customReport = XMLUtil.CreateXML()
customReport.LoadFile Environment.Value("REPORT_NAME")
Set root = customReport.GetRootElement()
Set TestSuite=root.ChildElements().Item(1)
Else
Call CreateXML()
Set root = customReport.GetRootElement()
root.AddChildElementByName "TestSuite",Desc
Set TestSuite=root.ChildElements().Item(1)
TestSuite.AddAttribute "startTime" ,cstr(Now)
TestSuite.AddAttribute "Desc", Desc
End If
End Function
No comments:
Post a Comment