我必須單擊一個儀表板,單擊menuitem後獲得顯示。並且menuitem和儀表板都在不同的框架。點擊動態div元素,這是在內部框架使用java Selenium WebDriver
<html>
<head>
<frameset scrolling="no" framespacing="0" marginwidth="0" marginheight="0" border="0" frameborder="0" rows="98,*">
<frame scrolling="no" noresize="" marginwidth="0" marginheight="0" src="menu.jsp" name="menu">
<script language="JavaScript">
<script type="text/javascript" src="menu7_com.js" language="JavaScript">
<div style="position: absolute; display: block; background-color: black; width: 1080px; height: 18px; z-index: 1101; top: 72px; left: 10px;">
<div style="position: absolute; overflow: hidden; cursor: default; color: rgb(0, 0, 0); font-family: Arial;font-size: 9pt; font-weight: bold; font-style: normal; background-color: rgb(224, 224, 224); text-align:left; width: 110px; height: 16px; padding-left: 10px; padding-top: 2px; left: 0px; top: 0px;">
<div style="position: absolute; overflow: hidden; cursor: default; color: rgb(0, 0, 0); font-family: Arial; font-size: 9pt; font-weight: bold; font-style: normal; background-color: rgb(224, 224, 224); text-align: left; width: 110px; height: 16px; padding-left: 10px; padding-top: 2px; left: 120px; top: 0px;">
</div>
<frame scrolling="auto" style="scrollbar-base-color:blue;" noresize="" marginwidth="0" marginheight="0" src="Dashboard.do?action=DashBoard" name="display">
<div style="position: absolute; overflow: hidden; cursor: default; color: rgb(0, 0, 0); font-family: Arial; font-size: 9pt; font-weight: bold; font-style: normal; background-color: rgb(224, 224, 224); text-align:left; width: 110px; height: 16px; padding-left: 10px; padding-top: 2px; left: 120px; top: 0px;">
</div>
</frameset>
</html>
嗯,默認情況下,你不能點擊一個不可見的元素。你可以分享到該網站的鏈接以及目前爲止的代碼嗎?謝謝。 – alecxe 2014-12-04 07:49:42
請從菜單項開始分享更多HTML代碼片段到您想要點擊的元素。 – Subh 2014-12-04 07:58:53