gpt4 book ai didi

jquery - 无法单击图标的元素

转载 作者:行者123 更新时间:2023-12-03 17:33:57 25 4
gpt4 key购买 nike

我对 selenium 有点陌生,我遇到了一个我无法点击的图标元素。请看下面的详细信息。

enter image description here

尝试了这个相对的 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第一的。

关于jquery - 无法单击图标的元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31236987/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com