网页上有text label
,我试图点击它打开一个弹出窗口,但没有打开。这是HTML
代码:
<td width="40%">
<div id="EmpId.outline">
<input type="hidden" name="EmpId" value="" id="popupEmpId">
<input type="text" name="EmpCode" value="" readonly="readonly" class="textMedium250" id="popupEmpCode" autocomplete="off"> <a href="#f2"><label onclick="checkForPopup('EmpPopupDiv','Select a Emp',640,true,refreshConditionOptions);"> + Search for a Emp</label> </a>
</div>
</td>
我必须点击标签+ Search for a Emp
,但不能这样做。
答案 0 :(得分:1)
尝试通过xpath查找元素并单击。根据您的示例,要查找/单击的xpath应该是这样的:
"//a[@href='#f2']"
答案 1 :(得分:0)
<td width="40%">
<div id="EmpId.outline">
<input type="hidden" name="EmpId" value="" id="popupEmpId">
<input type="text" name="EmpCode" value="" readonly="readonly" class="textMedium250" id="popupEmpCode" autocomplete="off"> <a href="#f2" onclick="checkForPopup('EmpPopupDiv','Select a Emp',640,true,refreshConditionOptions);"><label > + Search for a Emp</label> </a>
</div>
</td>