我对 selenium 有点陌生,我遇到了一个我无法点击的图标元素。请看下面的详细信息。
尝试了这个相对的 xpath,当我运行我的脚本时仍然没有发生任何元素异常。
.//*[@id='inforWsAppList']/li[2]/a
感谢所有愿意分享他们想法的人,谢谢!
尝试了切换帧的方法,仍然没有运气:
WebElement iframeElement = driver.findElement(By.id("lid://infor.social.mingleinstance1")); // This is the iframe that you're saying
driver.switchTo().frame(iframeElement);
driver.findElement(By.name(".//*[@id='inforWsAppList']/li[2]/a")).click(); // or [@id='inforWsAppList']/li[2]
driver.switchTo().defaultContent();
//
请您参考如下方法:
如果您仔细查看元素所在的位置,您会注意到 iframe作为 parent 之一。您需要切换到 iframe第一的。


