Javascript 尝试使用Selenium WebDriver单击SVG元素时,元素不可见

Javascript 尝试使用Selenium WebDriver单击SVG元素时,元素不可见,javascript,selenium,xpath,svg,webdriver,Javascript,Selenium,Xpath,Svg,Webdriver,当我使用此xpath单击SVG元素时,我得到元素不可见异常。若我使用Actions类,我可以点击它,但Firefox48 gecko驱动程序还不支持Actions类 我尝试了这个,但没有成功:(元素不可见异常) 我也试过了,但没有成功:(元素不可见异常) 我尝试了这个,它只在chrome上有效,但在Firefox 48 gecko驱动程序中无效: WebElment element = driver.findElement(By.xpath("//*[name()='svg']/*[na

当我使用此xpath单击SVG元素时,我得到元素不可见异常。若我使用Actions类,我可以点击它,但Firefox48 gecko驱动程序还不支持Actions类

我尝试了这个,但没有成功:(元素不可见异常)

我也试过了,但没有成功:(元素不可见异常)

我尝试了这个,它只在chrome上有效,但在Firefox 48 gecko驱动程序中无效:

    WebElment element = driver.findElement(By.xpath("//*[name()='svg']/*[name()='line' and @x1='195.5']"))
    Actions action = new Actions(driver);
    action.moveToElement(element).click().build().perform();
是否有其他方法单击此SVG元素

以下是html代码:

<div id="figed_canvas_axis_Figed_0" style="width:369px;height:369px;">
  <svg id="Figed_0_axis" viewBox="0 0 369 369">
    <line x1="195.5" y1="182.5" x2="195.5" y2="188.5" style="stroke:#808080;stroke-width:1"></line>

可能有用:可能有用:
    WebElment element = driver.findElement(By.xpath("//*[name()='svg']/*[name()='line' and @x1='195.5']"))
    Actions action = new Actions(driver);
    action.moveToElement(element).click().build().perform();
<div id="figed_canvas_axis_Figed_0" style="width:369px;height:369px;">
  <svg id="Figed_0_axis" viewBox="0 0 369 369">
    <line x1="195.5" y1="182.5" x2="195.5" y2="188.5" style="stroke:#808080;stroke-width:1"></line>