QTP常用方法

上一篇 / 下一篇  2011-02-22 20:03:27 / 个人分类:QTP 初学阶段

ChildItem方法


语法:object.ChildItem (Row,Column,MicClass,Index)

作用:用于获取单元格中的测试对象

实例:Set target_link=Browser("AE").Page("AE").Frame("mainFrame").WebTable("申请类型").WebTable("test:=编号.*").ChildItem(2,2,Link,0)

注意点:赋值为对象时一定要用set,单纯的变量赋值则不用

 

CaptureBitmap 方法

语法:object.CaptureBitmap FullFileName, [OverrideExisting]

描述:

     object  A test object of type WinEdit.
     FullFileName  Required. A String value. //必须全路径“XXX.bpm”
     OverrideExisting  Optional. A Boolean value. 0 or 1(True or False) i.e  to over the present file or not.

(0或者true是指如果该文件已经存在,则覆盖;1或者false如果该文件已经存在,则出错,告知文件已经存在)

作用:可以将对象图片拷贝到物理路径中存档

实例:Browser("AE").Page("AE").Frame("mainFrame").CaptureBitmap "C:\ScreenCaps\"&TimeStamp &".png"  ,true

 

 

Reporter.ReportEvent

语法:Reporter.ReportEventEventStatus,ReportStepName,Details[,Reporter]

描述:第一个参数的四种状态

     0 or micPass: Causes the status of this step to be passed and sends the specified message to the report. (通过)
     1 or micFail: Causes the status of this step to be failed and sends the specified message to the report. When this step runs, the test fails. (失败)
     2 or micDone: Sends a message to the report without affecting the pass/fail status of the test. (完成)
     3 or micWarning: Sends a warning message to the report, but does not cause the test to stop running, and does not affect the pass/fail status of the test. (警告但中断运行)

作用:输出结果

实例:

Reporter.ReportEvent 1, "Custom Step", "The user-defined step failed."       

or

Reporter.ReportEvent micFail, "Custom Step", "The user-defined step failed."

(from QTP Help)


TAG:

 

评分:0

我来说两句

日历

« 2024-04-10  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 8423
  • 日志数: 13
  • 建立时间: 2011-01-28
  • 更新时间: 2011-04-07

RSS订阅

Open Toolbar