我无法点击图像 - >地图 - >区域标记中的链接。任何人都可以帮助我解决这个问题。我想单击否(或)关闭。如何点击使用硒的图像上的链接java
<div id="IPEinvL" style="z-index: 10000; width: 439px; height: 360px; left: 463px; top: 0px; background-color: white; position: absolute; margin-left: 0px; margin-top: 0px;">
<img alt="Would you like to participate in a short study?" usemap="#IPEMap" src="XXXXXXXXXXXXXXXXXXXX.png" border="0" height="360" width="439">
<map name="IPEMap">
<area shape="rect" coords="405,15,424,33" href="javascript:clWin()" alt="close">
<area shape="rect" coords="117,229,214,258" href="javascript:fOpen()" alt="yes">
<area shape="rect" coords="225,229,323,258" href="javascript:clWin()" alt="no">
</map>
<img id="countInvites" src="XXXXXXXXXXXXXXXXX/Counter/counter_N.png?surveyID=120799&siteID=1&langID=1&traceID=2" style="border: 0px; margin-top: -10px;" alt="" height="0" width="0">
</div>
我都试过3种方法得到下面的异常org.openqa.selenium.NoSuchElementException:找不到元素:// * [@ id ='IPEinvL']/img/map/area [@ alt ='close'] –
抱歉xpath错误应该是// * [@ id ='IPEinvL']/map/area [@ ALT = '关闭'。请检查更新的xpath – Murthi
Xpath // * [@ id ='IPEinvL']/map/area [@ alt ='close']。为我工作。它拯救了我的一天。谢谢! –