QTP中与时间同步点:Sync、Wait、Waitproperty、Exist.docVIP

QTP中与时间同步点:Sync、Wait、Waitproperty、Exist.doc

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  4. 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  5. 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  6. 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  7. 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
QTP中与时间同步点:Sync、Wait、Waitproperty、Exist

QTP中与时间同步点:Sync、Wait、Waitproperty、Exist /html/74/27374-848211.html 同步点是QTP是很重要的一部分。常用的同步点方法有以下几种: 1)Sync方法; 2)WaitProperty方法; 3)Wait方法; 4)Exist方法; 1)Sync 只有browse和page对象具有Sync方法,其它的对象都不具有该方法,那么browse.sync和page.sync有什么区别呢? browse.sync表示等待浏览器加载完成后进行下一步操作,浏览器加载完成的标志是浏览器显示左下角显示完成字样。 page.sync表示页面中所有的元素都已加载完成后,进入下一步的操作。 语法:object.Sync 示例: Sub Sync_Example() The following example uses the Sync method to wait for the Mercury Tours page to synchronize. before performing the next operation. Browser(Mercury Tours).page(Mercury Tours).Sync End Sub ? 2)WaitProperty 等待指定对象属性获得指定值或超出指定超时后再继续下一步。如果属性获得该值则返回 TRUE,如果在属性获得该值之前发生超时则返回 FALSE(注意:FALSE 返回值不表示步骤失败) 语法:object.WaitProperty (PropertyName, PropertyValue, [lTimeOut]) 示例1: Sub WaitProperty_Example() The following example uses the WaitProperty method to wait for the All kind of links readyState to be complete or for 4 seconds (4000 milliseconds) to pass, whichever comes first. If the link achieves this value before 4000 milliseconds pass, QuickTest clicks the link. If Browser(index).Page(index).Link(All kind of).WaitProperty(attribute/readyState, complete, 4000) Then ??? Browser(index).Page(index).Link(All kind of).Click End If End Sub 示例2: Sub WaitProperty_Example() The following example uses the WaitProperty method to wait for the Account edit box to be enabled before setting its value to 123. If it is still disabled after the tests Object Synchronization Timeout time has been exceeded, it will not perform. the Set method. If Browser(index).Page(index).WebEdit(Account).WaitProperty(disabled, 0) Then ??? Browser(index).Page(index).WebEdit(Account).Set (123) End If End Sub 3)wait wait函数,当脚本走到wait函数时,就开始执行这个函数.如:wait(10),就等待10秒种后再继续执行下面的语句.wait函数的这个等待的时间,那相对来说是固定的,可能造成时间的浪费,或者等待时间的不足. 4)Exist 检查对象当前是否存在于打开的应用程序中。返回一个Boolean 值。 语法:object.Exist([TimeOut]) 示例: Sub Exist_Example() The following example uses the Exist method to determine the existence of the Mercury Tours browser. If the object exists, a message box appears confirmi

文档评论(0)

xcs88858 + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

版权声明书
用户编号:8130065136000003

1亿VIP精品文档

相关文档