java - UnhandledAlertException : 元素可以被执行但在系统中没有被点击
问题描述
“Contact”元素可以点击,但“Equity”元素下一行可以执行,但系统中没有点击。系统仍然显示“联系方式”页面。在 Eclipse 中,它显示线程“main”中的异常 org.openqa.selenium.UnhandledAlertException: :
代码是
Actions linktext1 = new Actions(driver);
WebElement contact = driver.findElement(By.xpath("//a[contains(text(),'Contact')]"));
linktext1.moveToElement(contact).build().perform();
driver.findElement(By.xpath("//a[contains(text(),'Contact')]")).click();
driver.findElement(By.xpath("//a[@onclick=\"navigateTo('CompanyCustomerEquity.do?event=edit_prepare_company_customer_equity')\"]")).click();
driver.findElement(By.xpath("//a[contains(text(),'Ownership')]")).click();
解决方案
推荐阅读
- openldap - LDAP,匿名身份验证
- javascript - 如何解决“拒绝加载脚本'https://connect.facebook.net/en_US/sdk.js',因为它违反了以下内容安全政策”?
- gitlab - GoCD 构建问题
- elixir - 如果地图在 Elixir 中有键,最好的方法是什么?
- java - 如何使用 HLF 中的事件通知客户端块提交和/或事务状态?
- flutter - ReorderableListView 物理
- azure - 如何在 Kusto 中编写一个表格函数,采用表格和标量参数的组合,以便您可以在整个组织中重用和共享它?
- scala - 如果我无法将记录解析为 Long,我想跳过它
- vue.js - vue 脚本中的数据更改未反映在浏览器输出中
- html - 如何将样式表从外部 URL 应用到特定的反应组件