-3
<div style="overflow:hidden;height:20px;" valign="middle">
<div id="IconImg_iconMenu_icon__dhtmlLib_274" class="imo"
style="width:16px;height:16px;background-
image:url('images/main/galleries/icon16x16gallery1b.png');background-
position:0px -208px;margin-top:2px;cursor:pointer"></div>
任何人都可以帮助我在Selenium中找到上述元素。试用不同的元素识别方法没有任何帮助。无法识别硒中的元素
您可以提供一些HTML样本和您迄今为止尝试过的任何代码吗? –
Html code is attached in my question .. driver.findElement(By.xpath(“div/* [(@ id ='IconImg_iconMenu_icon__dhtmlLib_274'(and(@class ='imo')]”))是我试过的方法 – AutomationTester
只需尝试driver.findElement(By.id(“IconImg_iconMenu_icon__dhtmlLib_274”)),否则请尝试xpath // div [包含(@ id,'IconImg_iconMenu_icon__dhtmlLib_')] – Murthi