Cannot click on path under svg element

Hello, i need some help. I need to click on a path item inside svg, RPA can find the item but i cannot click i tried all locators but none works.

The browser inspector css route is:

html.notranslate.react-use-css-0 body div#root.root div.layout.obt-background-image.react-use-css-0.is-studio.desktop.layout–obt-initialized div.layout__content main.layout__main div.layout__main-content.squared div.react-use-css-1-mode.-catalog.XL svg.cat-svg svg#choose path#n11

What i resumed to:

css=#root > div > div > main > div > div > svg > svg > path#n11

Also works as:

css=#root > div > div > main > div > div > svg > svg > path:nth-child(52)

as path:nth-child(52) is the css locator. But only works to find, not to click

If i try to use xpath then i get only:

//*[@id=“n11”] that dont work all at because it finds another item but if i get the HTML:

<path id="n11" data-testid="XL_Catalog_item_11" opacity="0.745536" fill-rule="available" clip-rule="available" d="M257.855 91.5354V63.7486H285.642V91.5354H257.855Z" fill="#2BDD97"></path>

and build a xpath locator like:

xpath=//*[@data-testid=“XL_Catalog_item_11”]

The same happens, it finds the item but cannot click on it, i searched and find its hard to click on a path under svg like this: svg > svg > path, the only solutions i found are for python and involves wait to be clickable but didnt find how to do in rpa.

Any help?

Thank you

Instead of trying to find the correct XPath, have you considered doing the RPA automation visually with XClick and/or XClickText?

I already have it done visually but is painfully slow and fails quite often.

That could be a javascript issue inside the website. Maybe try your selector plus XClick (instead of click)?

I tried it but for some reason i cannot use xpath neither css locator with xclick it wants an image to click at, also i saw the video tutorials and it seems its easy as change click for xclick but for some reason is not.

imagen

This is the error that appears when i change click for xclick with the same locator

[error] Line 58: empty x

wth is empty x?

any help? i’m still trying with no luck.

Hi, do you have a link to the website?

I’m afraid the website requires paid registration and is not public access, thats why i copied the CSS path, i tried to find a public access web with the same problem, but every web i’m able to find the “clicking” locators, i would also know if there are web thats are impossible to click no matter what you try or they are all clickable and you only need to find the correct locator?

TY.

sometimes complex javascript on a website can “swallow” the click event. But Xclick should always work.

Image search is certainly much slower than a HTML-level “click” event. But why does it fail often? That should not be. You can also try XClickText with local ocr.

It fails often because is a dynamic web that changes every 15-20 segs, so the web changes before the image search has finished, so fails in scrapping the correct item, because has already changed. Image search speed can be useful with static pages where you have all the time in the world, but with dynamic pages you need something fast and efficient