Sei sulla pagina 1di 1

Call GenerateWebObjSummary()

Function GenerateWebObjSummary()
ResPath=Environment("TestDir")&"\Report"&replace(replace(Now,"/","_"),":","_")&"
.txt"
ObjTypes=Array("Browser","Page","Images","WebElement","Link","Frame","WebList","
WebEdit","WebTable","WebRadioGroup","WebCheckBox")
Set DictionaryObject = CreateObject("Scripting.Dictionary")
For i=0 to ubound(ObjTypes)
DictionaryObject.Add ObjTypes(i),0
Next
DictionaryObject("Browser")=1
DictionaryObject("Page")=1
For i=2 to ubound(ObjTypes)
Set DescObject=Description.Create
DescObject("micclass").value=ObjTypes(i)
ObjCount=Browser("micclass:=Browser").Page("micclass:=Page").ChildObject
s(DescObject).Count
DictionaryObject(ObjTypes(i))=ObjCount
Next
ObjType=DictionaryObject.Keys
ObjCount=DictionaryObject.Items
WriteLog " *WebObject Count Summary*",ResPath
WriteLog ".-------------------------------.",ResPath
WriteLog "|Web Objects | Count |",ResPath
WriteLog "|----------------|--------------|",ResPath
For j=0 to ubound(ObjType)
WriteLog "|"&ObjType(j)&Space(16-len(ObjType(j)))&"| "&ObjCount(j)&Space(8
-len(ObjCount(j)))&"|",ResPath
TotalObj=TotalObj+ObjCount(j)
Next
WriteLog "|-------------------------------|",ResPath
WriteLog "|Total Objects | "&TotalObj&Space(8-len(TotalObj))&"|",ResPath
WriteLog "'-------------------------------'",ResPath
End Function
Function WriteLog(info,ResPath)
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(ResPath, 8, True)
f.WriteLine info
f.Close
End Function

Potrebbero piacerti anche