查看元素的来源如下,我在Console
下点击Alt
。我想使用JavaScript使元素可见。然后我想点击相同的元素,但这样做是点击下一个可见元素(即Order
)。
请为此问题建议解决方法。
<td id="PanelTable" onmouseover="this.className='menulevel1hl';" onclick="somthing">
Alt
</td>
<div id="somID" name="SomName" style="visibility:hidden;position:absolute;border:">
<DIV myonclick="Something">
Console
</DIV>
</div>
<td id="PanelTable" onmouseover="this.className='menulevel1hl';" onclick="Something">
Order
</td>
<div id="somID" name="SomName" style="visibility:hidden;position:absolute;border:">
<DIV myonclick="Something">
Order One
</DIV>
<DIV myonclick="Something">
Order Two
</DIV>
</div>
答案 0 :(得分:0)
尝试点击通过JS而不使元素可见
JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("arguments[0].click()", element);