硒点击区域不工作

本文关键字:工作 区域 | 更新日期: 2023-09-27 18:05:23

我有图像与数字,我建立一些方法,返回所有的数字区域和他们的区域id,但当我做点击什么都没有发生。

区域html代码:

<map id="tc_tclavier1438161670450" style="display:block" name="tc_tclavier1438161670450">
<area id="touche11" class="touche" coords="0,0,24,24" style="cursor: pointer;display:block;">
<area id="touche12" class="toucheVide" coords="24,0,48,24" style="cursor: pointer;display:block;">
<area id="touche13" class="touche" coords="48,0,72,24" style="cursor: pointer;display:block;">
<area id="touche14" class="toucheVide" coords="72,0,96,24" style="cursor: pointer;display:block;">
<area id="touche21" class="touche" coords="0,24,24,48" style="cursor: pointer;display:block;">
<area id="touche22" class="toucheVide" coords="24,24,48,48" style="cursor: pointer;display:block;">
<area id="touche23" class="touche" coords="48,24,72,48" style="cursor: pointer;display:block;">
<area id="touche24" class="toucheVide" coords="72,24,96,48" style="cursor: pointer;display:block;">
 </map>

在我使用我的方法后,我知道所有的数字和他们的id,我试图点击区域,但在不工作。

这是我尝试过的:

driver.FindElement(By.Id("touche13")).Click();
driver.FindElement(By.Id("touche13")).SendKeys(Keys.Return);
有谁知道我做错了什么吗?

硒点击区域不工作

检查Xpath路径和Css选择器语句