0

I have code which used to work recently but not any more

    String xpath = "//*[name()='svg']//*[name()='path' and @class='zone  priceDesc_0']";
    By path = By.xpath(xpath);
    WebElement el = driver.findElement(path);

    WebDriverWait wait = new WebDriverWait(driver, 10);
    wait.until(ExpectedConditions.elementToBeClickable(el);

    Actions actions = new Actions(driver);
    actions.click(el).build().perform();

Now I receive an error:

<path>...</path> is not clickable at point (466.316650390625, 667.25). Other element would receive the click: <tspan x="" y="" class=""></tspan>

According to what I have found in other topics here I have changed part which clicks to:

    JavascriptExecutor executor = (JavascriptExecutor) driver;
    executor.executeScript("arguments[0].click();", el);

and now I receive:

Exception in thread "main" org.openqa.selenium.JavascriptException: arguments[0].click is not a function

What is wrong ?

kris82pl
  • 977
  • 3
  • 12
  • 21
  • SVG paths are clickable. Can you debug and see what are you getting in WebElement el = driver.findElement(path); Is there a change in the SVG itself? – GSSwain Apr 24 '18 at 02:15
  • Possible duplicate of [Element MyElement is not clickable at point (x, y)... Other element would receive the click](https://stackoverflow.com/questions/44724185/element-myelement-is-not-clickable-at-point-x-y-other-element-would-receiv) – undetected Selenium Apr 26 '18 at 16:02

0 Answers0