本文介绍了使用Web加载项时,UFT如何执行Click方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用UFT 11.50在Internet Explorer 8.0上测试基于JavaScript的高度应用程序.我想知道UFT在使用Web Add In时如何在后台实现"Click"方法. UFT是否发送Windows鼠标事件?是否触发事件(onclick,onmousedown,onmouseup)?我的应用程序看到了一些不同的结果.

I am testing a highly javascript based application on Internet Explorer 8.0 with UFT 11.50. I would like to know how UFT implements the "Click" method under the hood when using the Web Add In. Does UFT send a windows mouse event? Does it fire an event (onclick, onmousedown, onmouseup)? I have been seeing some mixed results with my application.

推荐答案

默认情况下,它可以使用DOM事件执行UFT重放,但是您可以将重放类型更改为设备,在这种情况下,它将查询HTML元素的位置并模拟鼠标单击该位置.

It can do either, by default UFT replays using DOM events but you can change the replay type to device in which case it queries the HTML element's location and simulates a mouse click on that location.

重播模式由工具-> Opitions-> Web->高级-> RunSettings 或在脚本中通过以下方式控制:

The replay mode is controlled by Tools->Opitions->Web->Advanced->RunSettings or in the script by:

Setting.WebPackage("ReplayType") = 2 ''# Changes to device mode
Setting.WebPackage("ReplayType") = 1 ''# Changes to event mode

请注意,在事件模式下,UFT不仅发送click,它还会发送应用程序通常使用的其他事件(例如focusmousedownmouseup),除非注册表值 WebPackage 设置中的> ReplayOnlyClick 设置为1.

Note that in event mode UFT doesn't just send a click, it sends other events that typically are used by applications (such as focus, mousedown and mouseup) unless the registry value ReplayOnlyClick in the WebPackage settings is set to 1.

这篇关于使用Web加载项时,UFT如何执行Click方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 22:57