1

In web page,there are few tabs like CustomerAccountContact. These tabs are inside SPAN html tag.

I have added the web element for Account in OR. When I try to highlight it works fine but when I try to click using Click method its not going to the Account tab.

If I take the abs_x and abs_y of the web element and try to click using mercury.devicereply object it works fine.

PFB, the html source code for accounts tab:

<a class="x-tab-right" onclick="return false;" href="#">
    <em class="x-tab-left">
        <span class="x-tab-strip-inner">
            <span class="x-tab-strip-text ">
                Account
            </span>
        </span>
    </em>
</a>
Motti
  • 110,860
  • 49
  • 189
  • 262
rijinrv
  • 2,029
  • 2
  • 16
  • 17

3 Answers3

0

Since the link has an onclick="return false;" this means that click events don't do anything and the application reacts to different events. Apparently these events aren't those that UFT fires when it simulates a Click event.

You have two options as I see it.

  1. Find out what event the application is reacting to and fire that event in the test (instead of performing a click)
  2. Use device replay, this can be done more simply than using the Mercury.DeviceReplay object as you're doing by changing the replay-type to device (as explained in this answer).
Community
  • 1
  • 1
Motti
  • 110,860
  • 49
  • 189
  • 262
0

It is occurring because application is firing different event. Even fire event may not work in this case. Since it is already working with Mercury device replay it would be better for you to create and register it (RegisterUserFunc).

RegisterUserFunc "WebLink", "fLnkClick", "fLnkClick"

0

Use: Before click method

 Setting.WebPackage("ReplayType") = 2

After click method

 Setting.WebPackage("ReplayType") = 1

If you set Replay Type = 2 then you are giving control to Mouse, which do the actions similar the way you do manually. So clicks, mouseover and other mouse related actions will work if normal QTP click fails. Also we can use "Mercury.DeviceReplay" object for the implementing similar logic.

rijinrv
  • 2,029
  • 2
  • 16
  • 17