如何使用硒webdriver打开弹出窗口表? [英] how to open pop up window table using selenium webdriver?
本文介绍了如何使用硒webdriver打开弹出窗口表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
网页上有text label
,我尝试单击该按钮以打开弹出窗口,但没有打开.这是HTML
代码:
there is text label
on a webpage, and I am trying to click on that to open a pop-up window,but not getting opened. here is the HTML
code:
<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
,但不能这样做.
I have to click on the label + Search for a Emp
, but could not do that.
推荐答案
尝试通过xpath查找元素,然后单击.根据您的示例,要查找/单击的xpath应该是这样的:
Try to find element by xpath and click. Based on your example, the xpath to find/click should be something like this:
"//a[@href='#f2']"
这篇关于如何使用硒webdriver打开弹出窗口表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文