Katalon records a different item

When I’m recording with Katalon studio, the wrong items are registrated in the script.

In this example I’m recording ‘Klachtenregeling’ but Katalon is showing ‘Actievoorwaarden’ in the script (‘Actievoorwaarden’ is located above ‘Klachtenregeling’).

This happens with Chrome and Firefox and I’m using Katalon Recorder 3.8.2.

Can someone explain this to me? Thanks!

Hi @m.hoefste

It is not a wrong locator. The XPath is locating the element that follows the element with text ‘Actievoorwaarden’. It is called Neighbor XPath because it locates the desired element based on its neighbors. Read the XPath carefully and you will see how it works.

You can choose a different XPath if you want though.

Cheers !

Hi m.hoefste

The XPATH does not wrong as ThanhTo mentioned, it just detects in the other form format. In this case, its use /following:

Example
xpath=(.//*[normalize-space(text()) and normalize-space(.)=‘Example Link’])[1]/following::a[1]

With the above XPATH it will locate the link text after (below) “Example Link” menu.

But in this case, I think the better way should be link=Klachtenregeling

P.s: Can you refresh the page, click on the first menu item and then click the other menu? I think it should detect and locate again by link text instead of following

Thank you!

Thank you!

Hi Sang, I refreshed the page and clicked on the first menu item but it doesn’t locate by link text. Is there another way to get Katalon recording by link text instead of following?
Thanks again!