QTP - 15 (Synchronization) 同步问题

QTP - 15 (Synchronization) 同步问题

Writer : Tarun Lalwani


怎样等待此页面加载完再执行测试步骤?这就是同步的问题:

主题1:

Synchronization Points: when application take time torespond your action. Being used to pause or wait time.

Three types of Synchronization Points:

1st Method – Using the Sync method: there are nodifference between Sync on browser and page.

Browser(“..”).Sync

But sometimes itself throw an error, use On Error resumenext constructs should be used as below

On Error Resume Next

Browser(“..”).Sync

On Error Goto 0

 

2nd Method – Using the wait statement

wait 2

 

3rd Method – waitProperty method

Browser(“..”).Page(“..”).WebButton(“Next”).waitProperty(“Enabled”,True, 5000) ‘wait 5s max to button enable.

In case the object not exist before the operation starts “

Browser(“..”).Page(“..”).WebButton(“Next”).Exist(20)


主题2:

Events: there maybe synchronization does not help, becauseof events not fired!

               DP 时常用。

E.g only you input the webEdit, then OK button enabled.

方法一:代码firethe events:(可以查看event录制时是否支持ToolsàWeb Event RecordingConfiguration… and click the Custom Settings)

You need the code what event included, if you don’t know youcan fire all events:

Browser(“..”).Page(“..”).WebEdit(“..”).FireEvent “onkeydown”

Browser(“..”).Page(“..”).WebEdit(“..”).FireEvent “onkeyup”

Browser(“..”).Page(“..”).WebEdit(“..”).FireEvent“onkeypress”

 

方法二:设置Replaysetting, 不以eventfire, 用mousefire:

Tools-->Options…-->Web-->Advanced..and Replay Type radio value as Mouse.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值