My Blog List

Friday, August 26, 2011

QTP - Logging with folder structure

'QTP - Logging with folder structure for cases------

Function PushLog(StepName, StepDetail)
Dim dicMetaDescription, intContext
Set dicMetaDescription = CreateObject("Scripting.Dictionary")
dicMetaDescription("Status") = micGeneral
dicMetaDescription("PlainTextNodeName") = StepName
dicMetaDescription("StepHtmlInfo") = "
" + StepDetail +"
"

'Some backdoor settings:
'dicMetaDescription("DllIconIndex") = 206
'dicMetaDescription("DllIconSelIndex") = 206
dicMetaDescription("DllPAth") = "C:\Program Files\HP\QuickTest Professional\bin\ContextManager.dll"

intContext = Reporter.LogEvent("User", dicMetaDescription, Reporter.GetContext)
'Set the new report node as a parent
'From now on, all reports will be added under this node
Reporter.SetContext intContext
End Function

Function PopLog()
'Now return to the parent level:
Reporter.UnSetContext
End Function



'So Calling will be like,
For CaseNo = 1 to CasesCount
Call PushLog(CaseID, CaseName)
For Iteration =1 to DataCount
Call PushLog(CaseID + " - Iteration: "&Iteration, CaseName)
Eval("Case"&CaseNo)
Call PopLog()
Next
Call PopLog()
Next

1 comment:

  1. Thanks for sharing great information in your blog. Got to learn new things from your Blog . It was very nice blog to learn about Selenium

    ReplyDelete