3 things to do when QTP/UFT won’t click on a basic link in an application

Occasionally, we come across a link object in an application, in which QTP/UFT can't actually click on. QTP/UFT recognizes the link, but cannot click on it. QTP/UFT will run as if it clicked the link, but the application won't navigate to the link's set location. This can occur from time to time and I am here to make sure that when this situation arises, you are fully prepared to deal with it quickly. Below, I have three ways that you may be able to deal with this type of QTP/UFT issue.

1. Using the FireEvent method in QTP/UFT is always a second best option when the regular click link method is not working. The FireEvent method is used to simulate user mouse actions a bit more closely than the general QTP/UFT methods. You can simulate other user mouse actions like hover over, and double click as well. The syntax for the method is shown below.

Browser("name:=").Page("title:=").Link("name:=").FireEvent("onclick")

Other FireEvent Options:

•onchange
•onclick
•ondblclick
•onblur
•onfocus
•onmousedown
•onmouseup
•onmouseover
•onmouseout
•onsubmit
•onreset
•onpropertychange

2. If clicking on an object is still not working, you can change the webpackage in QTP/UFT. What that does is it activates actual mouse and keyboard strokes as if a user is using the app.

Setting.WebPackage("ReplayType") = 2

Browser("name:=").Page("title:=").Link("name:=").Click

Setting.WebPackage("ReplayType") = 1

Set the webpackage to 2 before you perform the action on a link. This will activate the actual mouse movement as if a users action is clicking on a the link. Make sure to set the the webpackage to the default replay type 1 after using this method. Otherwise, it can affect your other QTP/UFT actions.

3. If clicking on a link still isn't working, try the combination of methods 1 and 2.

Setting.WebPackage("ReplayType") = 2

Browser("name:=").Page("title:=").Link("name:=").FireEvent("onclick")

Setting.WebPackage("ReplayType") = 1

 

Most of the time, one of these 3 workarounds will fix the issue. If your problem still persists, leave a comment below. Make sure that your link is being recognized by QTP/UFT first. If the link is not being found by QTP/UFT, it's an object identification issue. Hope this helps!

Pin It on Pinterest

Clef two-factor authentication