Unable to click on object ‘Object Repository message

I’m running a very simple script. Navigating to a web site, adding an item to a shopping cart, viewing the cart contents, continue shopping, then I close the browser.

How do I resolve Getting this message:

Unable to click on object ‘Object Repository/Page_Engagement Rings Wedding Rings (2)/a_Animal’ located by ‘By.xpath: //a[count(. | id(“nav”)/div[@class=“block”]/ul[1]/li[@class=“has-child active”]/ul[@class=“sub-cat”]/li[@class=“row”]/div[@class=“xlarge-11 xlarge-centered columns”]/div[@class=“row”]/div[@class=“xlarge-8 columns xl-pad megamenuleft”]/ul[@class=“nav-item__first-level”]/li[@class=“column-list-1 column-list”]/ul[1]/li[@class=“column-list-1 column-list”]/ul[1]/li[1]/ul[@class=“no-bullet show-for-xlarge-up inner-nav-list”]/li[1]/a[1]) = count(id(“nav”)/div[@class=“block”]/ul[1]/li[@class=“has-child active”]/ul[@class=“sub-cat”]/li[@class=“row”]/div[@class=“xlarge-11 xlarge-centered columns”]/div[@class=“row”]/div[@class=“xlarge-8 columns xl-pad megamenuleft”]/ul[@class=“nav-item__first-level”]/li[@class=“column-list-1 column-list”]/ul[1]/li[@class=“column-list-1 column-list”]/ul[1]/li[1]/ul[@class=“no-bullet show-for-xlarge-up inner-nav-list”]/li[1]/a[1])]’ not found)

Why am I being asked to login to view the solution above? I’m ALREADY logged in and cannot login with my current credentials. I’m then told when trying to reset password that there’s no reset functionality for documentation. The solution above is absolutely useless if one can’t access it. Would you agree?

Hi there,

The error message is obvious: ‘Object is not found’. The reason is Katalon Studio can’t locate the ‘link’ element using the provided xpath

//a[count(. | id(“nav”)/div[@class=“block”]/ul[1]/li[@class=“has-child active”]/ul[@class=“sub-cat”]/li[@class=“row”]/div[@class=“xlarge-11 xlarge-centered columns”]/div[@class=“row”]/div[@class=“xlarge-8 columns xl-pad megamenuleft”]/ul[@class=“nav-item__first-level”]/li[@class=“column-list-1 column-list”]/ul[1]/li[@class=“column-list-1 column-list”]/ul[1]/li[1]/ul[@class=“no-bullet show-for-xlarge-up inner-nav-list”]/li[1]/a[1]) = count(id(“nav”)/div[@class=“block”]/ul[1]/li[@class=“has-child active”]/ul[@class=“sub-cat”]/li[@class=“row”]/div[@class=“xlarge-11 xlarge-centered columns”]/div[@class=“row”]/div[@class=“xlarge-8 columns xl-pad megamenuleft”]/ul[@class=“nav-item__first-level”]/li[@class=“column-list-1 column-list”]/ul[1]/li[@class=“column-list-1 column-list”]/ul[1]/li[1]/ul[@class=“no-bullet show-for-xlarge-up inner-nav-list”]/li[1]/a[1])]

From my observation, this xpath is quite complicated so it will be an obstacle to locate an element. The better solution is to use simplier xpath following with this XPath nesting issue and suggested solution guideline: https://docs.katalon.com/display/KD/Solving+common+automation+problems+using+Katalon+Studio