如何自定义VP比较方法?
各位高手,在VP的比较中,Robot允许使用自己定义的函数对actual data和baseline进行比较。不知道是否有这方面的例子,请高手们指教。 为什么要自己定义函数 发掘新鲜事物阿,而且这样的话,可以在自定义比较函数中做更多的事情,比如同步文件内容,或者通知某应用程序做一些工作等等。 vp只是个简单的判断,我看不出来楼主想问什么,要例子就免了 这个问题曾经问过ibm的人回答如下:
关于对验证点的直接操作,我们建议使用Custom VP的方法:
有三个函数和这一操作密切相关:
1〉、 currFilepath = SQAVpGetCurrentBaselineFileName("MyVP","CSV")
该函数返回当前验证点基线文件名(含路径):currentbaseline
The currentbaseline takes the directory path to the verification point
as it appears in the Robot GUI script. The directory path should include
the name of the verification point file. That file can be found in the
project's TestDatastore\DefaultTestScriptDatastore\TMS_Scripts\vp
folder.
The naming convention for file is
ScriptName.VerificationPointName.base.grd (for Clipboard, Menu & Object
Data VPs)
ScriptName.VerificationPointName.base.img (for Region & Window Image
VPs)
ScriptName.VerificationPointName.base.obp (for Object Property VPs)
ScriptName.VerificationPointName.base.txt (for Alphanumeric VPs).
2>、 ExpectedFilepath = SQAVpGetBaselineFileName("MyVP","CSV")
该函数返回当前验证点基线文件名(含路径):expected baseline ,它包含运行
时我们对验证点的期望值
The expected baseline takes the directory path to the expected
verification point as it appears in the log. This is the result that
Robot expects to capture during playback. The directory path should
include the name of the verification point file. That file can be found
in the project's TestDatastore\TMS_Builds\BuildName.Build\LogFolderName.
LogFolder\LogName.Log\vp folder (where BuildName, LogFolderName and
LogName are the names of the build, log folder and log to which the
script was played back).
The naming convention of the expected baseline file is the same as the
currentbaseline file, except that the expected baseline file uses exp
instead of base.
3>、actFilepath = SQAVpGetActualFileName("MyVP","CSV")
该函数返回包含当前验证点实际获得值的文件名(含路径):actual baseline
The actual baseline takes the directory path to the actual verification
point. This will only be generated if the results captured on playback
differ from the expected verification point. The directory path should
include the name of the verification point file.
The actual baseline file, it is exists, is in the same location as the
expected baseline file. The naming convention of the actual file is the
same as the expected baseline file, except that the actual baseline file
uses actXXXX instead of exp. XXXX is a random 4 character alphanumeric
string that is generated during playback. The user will need to browse
to the LogName.log\vp folder to find out the what the XXXX actually is.
不过我没看懂……因为又发现了比较简单的办法(也是ibm的人提供的,直接写日志的方法达到类似于验证点的作用):
1>.If you want a customer VP log , you need do it as :(I have sent you
this example)
If compareResult = False Then
Call SQAVpLog(sqaFail,"MyVP","",loggedFilepath,actFilepath)
Else
Call SQAVpLog(sqaPass,"MyVP","",loggedFilepath,"")
End If
2>.if you just want have a log message :
You can use
SQAlogmsg(...)
[ 本帖最后由 youyun 于 2006-2-10 22:54 编辑 ] 不清楚楼主的意思 好像youyun说的和楼主说的不一样,楼主是想直接自己定义一些比较函数,如sqapropertyget这样的,youyun说的是对已存在验证点文件的操作。
页:
[1]