在SVG饼图元素上执行鼠标悬停不起作用

perform mouse hover on a svg pie chart element not working

提问人:Vin 提问时间:6/1/2022 最后编辑:Vin 更新时间:9/19/2022 访问量:209

问:

使用量角器,我正在尝试在 svg 饼图元素上执行鼠标悬停,但鼠标悬停根本不起作用。也没有显示任何错误。我正在尝试阅读当鼠标悬停在元素上时显示在 chare 中的文本

  let emailBatchitems = element.all(by.xpath("//div[contains(@class,\"DonutChart_donut-legend-wrapper\")]/*[local-name()='svg']/*[local-name()='path']"))
   emailBatchitems.map(function(emailBatchelem){
      browser.actions().mouseMove(emailBatchelem).perform();
      let emailBatchName = element.all(by.xpath("//div[contains(@class,'DonutChart_donut-legend-wrapper')]//*[local-name()='text']"))
      emailBatchName.getText().then((text) => {
           console.log("The email batch name is " + text)
      })
    })

源 截图

在mousehover之前 [1]:https://i.stack.imgur.com/IY0GE.png

在Mousehover之后 [2]:https://i.stack.imgur.com/0due2.png

selenium-webdriver SVG 量角器

评论

0赞 Paul LeBeau 6/1/2022
请用一个有效的最小可重复示例更新您的问题。
0赞 Vin 6/2/2022
我能够使用此票证中提到的方法解决我的问题 stackoverflow.com/questions/36231434/...

答:

0赞 Praveen kumar 9/19/2022 #1

尝试用 span 标签包装 并将 传递给 span 标签,并尝试在<svg>idid