ocnuybear Absent Member.
Absent Member.
1543 views

Recorded Xpath link clicks the wrong link - Vb Net

Jump to solution

I recorded the click on this page: store.steampowered.com/ I want to click on the left arrow (big carousel element in the middle), but instead it clicks on the "By Friends" link on the left. Inspecting it with Chrome Inspect seems correct, but not sure why it is triggering the wrong element. Here is the recorded Xpath: (By.XPath("//div[@id=""home_maincap_v7""]/div[@class=""arrow left""]/div")).Click() I'm using VB.net

0 Likes
1 Solution

Accepted Solutions
ocnuybear Absent Member.
Absent Member.

RE: Recorded Xpath link clicks the wrong link - Vb Net

Jump to solution
Hi Ralph,

Thank you for the reply, I figured out what the problem was, there seems to be an issue with the chrome driver, if the page zoom is not 100%, it will click a wrong link where it think it was not taking into account the zoom, but the zoom level does not affect Silk Web driver, calculating it's relative click position correctly each time.
0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Recorded Xpath link clicks the wrong link - Vb Net

Jump to solution

Hi!

I think the recorded locators are correct, but it seems that the web page requires that you move the mouse over the button before clicking it. You can record that with Silk WebDriver as well like this:

  • Start recording
  • Right-click the “left arrow” button
  • Select “Mouse Move” from the action chooser pop up menu:
  • Right-click the “left arrow” button again
  • This time, select “click” from the action chooser pop up menu:
  • Silk WebDriver will record the following actions:
  • If you select those two actions in the sidebar and click the “Play” button at the bottom, you should see that the image viewer on the page actually scrolls to the previous image.

Of course after you export the script to VB.NET it should work as well.

Best regards,
Ralph

0 Likes
ocnuybear Absent Member.
Absent Member.

RE: Recorded Xpath link clicks the wrong link - Vb Net

Jump to solution
Hi Ralph,

Thank you for the reply, I figured out what the problem was, there seems to be an issue with the chrome driver, if the page zoom is not 100%, it will click a wrong link where it think it was not taking into account the zoom, but the zoom level does not affect Silk Web driver, calculating it's relative click position correctly each time.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.