Selenium 是否使用画布执行连续鼠标悬停?

Selenium 是否使用画布执行连续鼠标悬停?,selenium,Selenium,[必须单击左侧的一个选项小部件(请参见Image1.PNG)将显示如所示的单行(请参见[),然后将鼠标悬停在每个值上,并且必须捕获该特定行的每个值的工具提示。。 左侧和右侧小部件的xpath是: @FindBy(xpath="//*[@id='tabZoneId21']/div/div/div/div[1]/div[5]/div[1]/canvas") WebElement wbcanvasWidgetLeft; @FindBy(xpath="//*[@id=\"view515977

[必须单击左侧的一个选项小部件(请参见Image1.PNG)将显示如所示的单行(请参见[),然后将鼠标悬停在每个值上,并且必须捕获该特定行的每个值的工具提示。。 左侧和右侧小部件的xpath是:

@FindBy(xpath="//*[@id='tabZoneId21']/div/div/div/div[1]/div[5]/div[1]/canvas")
    WebElement wbcanvasWidgetLeft; 

@FindBy(xpath="//*[@id=\"view5159778620503418402_17231458509407196328\"]/div[1]/div[2]/canvas[2]")
    WebElement wbcanvasWidgetRight;
当我将鼠标悬停在每个值上时,下面的代码会突出显示,只有'left'的值会更改,否则所有选项都是静态的

[![<div class = “ tab-tooltip tab-widget tab-tooltipAR”  style=”user-select: none; -webkit-tap-highlight-color: transparent; top: 1px; **left:119px**;”>… </div>
<div class=”tab-tooltipContainer”>
<div class =”tab-tooltipContent” wairole=”alert” style>
<div class=”tab-ubertip tab-widget” style=”min-width: 368px;”>.
<div class =”tab-ubertipContent”>
<div class=”tab-ubertipTooltip”>
<span style =”white-space:pre-wrap;tab-size:10;-moz-tab-size:10”>
<div style=”text-align:left;”>
                    <span style=””>Health Group </span>
</div>
<table style=”vertical-align:top;padding:0px” cellspacing=”0”>
<tbody>
<tr>
<td style =”white-space:pre”>
    span style=”font-family”     >97</span>
</td>
<td >
    <span style=”font-”  >Minimum</span>
</td>][1]][1]
我可以在style属性的帮助下使用javascript executor吗?在这里,我为'left'设置了边距值,但我不知道在编写xpath时如何为style属性设置边距。
任何帮助都将不胜感激。

看起来您忘了包含图像(您提到了Image1.PNG,但问题中没有图像)。谢谢,我刚刚添加了。我不确定我是否完全理解,但似乎您可以使用一个以“/div[contains”(@style,“left:specific px value”)”为目标的xpath,然后将鼠标悬停在该元素上。(可能还包括检查包含“tab tooltipAR”的类)
public void sikuli() throws FindFailed, Exception {

 driver.switchTo().frame(driver.findElement(By.cssSelector("iframe[title='data visualization']")));

        try{
        //Captured image of first option(Health) and clicked on in it       
     Screen s = new Screen();

                 Pattern target = new Pattern("Health.PNG");
                 s.wait(target,20);
                 s.mouseMove(target);
                 s.click();

Actions act = new Actions(driver);
    act.moveToElement(wbcanvasWidgetLeft).moveByOffset(-50,0).moveToElement(wbcanvasWidgetRight).build().perform();
    //Capturing Tooltip
    System.out.println(driver.findElement(By.xpath("//div[@class='tab-ubertipTooltip']/span/div[3]/span[1]")).getText());
    System.out.println(driver.findElement(By.xpath("//div[@class='tab-ubertipTooltip']/span/div[4]/span")).getText());

      }
         catch(Exception e)
            {
                 e.printStackTrace();
              }

          driver.switchTo().defaultContent();
    }