QTP-Reporter的logevent应用的细节说明!
上一篇 /
下一篇 2009-05-27 15:38:56
/ 个人分类:笔记
VwM5j)nIL7h"y!lA0直接进入主题..
&_I [5H/^!r$T]
[01NwY$f2M!H6uBXj0有想自己定义QTP的报告格式的都应该查找到这么一篇资料,就是QTP REPORTER对象解密的文章,里面说到3个关键的方法.(其实帮助是没有这个使用的说明的,但是只要编写代码的人有调试的良好习惯,在调试窗口加上Reporter对象,你就可以看到这个对象的所有方法以及属性成员了。)51Testing软件测试网Zb,n?&C#[+~0B
_\E!PA!k#~3m9C0Reporter.UnSetContext51Testing软件测试网LK:n2_;}+X(h I
"JXs&r:Py1q0Reporter.LogEvent("User", dicMetaDescription, Reporter.GetContext)
.x
g
?Zw,R;N051Testing软件测试网2@c-nqM;z7wReporter.SetContext intContext
8GR xR^051Testing软件测试网+\c~X"F/q+`
`u5B定义了函数如下:51Testing软件测试网^|k9D(cSV?'f
51Testing软件测试网1L!M!HiH&uPublic Function EnterNode(ByRef NodeName, ByRef NodeContent) 51Testing软件测试网"dc9^*nB,CX#rvv
Set dicMetaDescription = CreateObject("Scripting.Dictionary")
:p3d:^9|p4z7Pko
`0 dicMetaDescription("Status") = MicDone
czx7`$~9Z
e0 dicMetaDescription("PlainTextNodeName") = NodeName 51Testing软件测试网C4E:t
o3{
p [w6s
dicMetaDescription("StepHtmlInfo") = NodeContent
#_ `A#boz0 intContext = Reporter.LogEvent("User", dicMetaDescription, Reporter.GetContext)