3

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.

Diggs
  • 81
  • 1
  • 6
  • 11

1 Answers1

3

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.

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

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.

Motti
  • 110,860
  • 49
  • 189
  • 262
  • Thanks for the detailed response. When UFT is in event mode, is there a certian set of events that are allows sent? Does it depend on that browser you are testing? For instance, when testing internet explorer, will UFT always send, focus, mousedown, mouseup events, in that order? – Diggs Jul 18 '13 at 12:34
  • Don't forget the `click` event :) I believe that the order of events is consistent and the same for all browsers. You can write some HTML that logs the events it receives and check. – Motti Jul 21 '13 at 19:46
  • Hi @Motti, When you say "event" mode, does it mean UFT injects javascript into the application to do the click? – Sriram Sridharan Jul 20 '18 at 11:27
  • @sriramsridharan UFT has a browser extension that lets it interact with the web page – Motti Jul 20 '18 at 11:52
  • @Motti Thank you. Is this different from JS injection? Because the add-on finally executes JS on the web page to interact with the page if i'm not wrong. – Sriram Sridharan Jul 23 '18 at 06:19
  • @sriramsridharan, browser extensions have direct access to the DOM, the extension may be written in JS (for IE it can be .NET/C++). The extension may also inject JS into the page, how it works is an implementation detail that shouldn't really make any difference to you. – Motti Jul 23 '18 at 07:14