![]() |
安静的苦瓜 · selenium获取元素文本值· 2 月前 · |
![]() |
闯红灯的大象 · selenium--cookie操作__se ...· 2 月前 · |
![]() |
爱喝酒的圣诞树 · vba通配符模糊查找Word-掘金· 1 年前 · |
![]() |
痴情的红薯 · Win10/Win7 ...· 1 年前 · |
![]() |
坚韧的椅子 · 从 DejaVu Sans Mono 换成 ...· 1 年前 · |
![]() |
爽快的夕阳 · 真·大语言模型Stable ...· 1 年前 · |
![]() |
小胡子的台灯 · MySQL 5.6 ...· 1 年前 · |
我正在测试一个应用程序,在该应用程序中,我必须单击一个菜单按钮,该按钮将显示一组菜单设置。我必须单击其中一个菜单选项才能浏览页面。示例HTML代码如下所示。
<custom-icon icon="menuDown"></custom-icon>
<div class = "settings" hidden="hidden">
<div class="settingItems"> View Settings </div>
</div>
在这里,如果我单击自定义图标(按钮),隐藏的选项div将变为可见,我可以单击View Settings div导航到某个页面。但是由于设置div是隐藏的,所以我无法访问它。有没有人能帮我一下。我使用flow的主要目的是单击View Settings按钮(在隐藏的div中)并导航到另一个页面
我已经尝试单击自定义图标,然后单击View Settings div。我收到一个element not clickable错误。我猜点击自定义图标并不能使设置div可见。我还尝试使用此代码使隐藏的div可见。
WebElement settingsMenu = driver.findElement(By.xpath("//div[@class='settings']"));
((JavascriptExecutor) browserDriver).executeScript("arguments[0].style.height='auto';arguments[0].style.visibility-'visible';",settingsMenu);
即使这样也不起作用
发布于 2019-09-30 03:55:13
尝试在webdriver初始化之后或在单击元素之前添加隐式等待。
driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS) ;
https://stackoverflow.com/questions/58156875
复制相似问题
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2023 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号: 粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287