How to resolve FireEvent not working issue in UFT

Is FireEvent not working in your UFT Script ??

UFT provides a very easy to use and robust in built method to click on objects in Webpage and other type of applications. This click functionality in UFT is very robust and works almost all the time. Sometimes It doesn’t work and we tend to use fireEvent to achieve click in this scenario.

There will be some scenarios when FireEvent fails as well to achieve the Click operation we are looking for. This difficulty can be overcome by manipulating the ReplayType setting in the UFT. 

We have to change the ReplayType to 2 , click on the desired element and change it back to 1.

IMPORTANT! — Don’t forget to change it back to 1 as it will cause unexpected failures in your automation.

How to change the ReplayType in UFT through code

In your UFT test, if FireEvent not working during script execution, you can change it through code as well. UFT provides ways to alter the settings of UFT itself through code. This is called AOM (Automation object model). Here is the code to change the ReplayType during runtime and change it back to 1.

Setting.WebPackage(“ReplayType”)=2
Browser(“browserObject”).Page(“PageObject”).WebElement(“infoIcon”).FireEvent “onmouseover”
Setting.WebPackage(“ReplayType”)=1
How to change the ReplayType in the UI of UFT.

In case if you want to resolve your fireevent not working through UI and change the ReplayType through UI of UFT. Here is the path you need to follow. You can find the ReplayType in the settings of UFT Options> GUI Testing> Web> Advanced> Replay Type

1 corresponds to Event and 2 corresponds to Mouse.

Click OK to save it.

Replay Type in UFT Options

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.