QTP以及selenium的mouseOver使用 鼠标悬停的事件很给力!

QTP对 界面上元素的鼠标悬停,弹出tips或者自动弹出窗口,需修改replaytype,

既在操作之前,加入:

Setting.WebPackage("ReplayType") = 2 。

 

再 +   .FireEvent "onmouseover" 一般是能生效的。

 

 关于QTP的replaytype

What is ReplayType?

ReplayType is QTP Web Add-in setting. It can be used to change how the events are replayed on the browser. There are two modes of ReplayType

  • Events (1) – Replay of events using the Browser methods (something similar to DOM).
  • Mouse (2) – Replay of events using the mouse and keyboard simulation.

When to change ReplayType?

Use of ReplayType can be best explained by a below example. In below sample textbox we need to type in any value and see that the button gets enabled when there some text in the textbox and disabled when there is not text. Click on the button will display the values inside the textbox.

详见:http://knowledgeinbox.com/articles/qtp/settings/when-to-change-qtp-web-replaytype-setting/

 

-------------------------------------------------------------------------------

而selenium 完成任务,如下即可(IDE工具中):

<tr>
 <td>mouseOver</td>
 <td>id=userInfo</td>
 <td></td>
</tr>

 

你可能感兴趣的:(selenium,web自动化)