首页 > 解决方案 > 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();

标签: javaselenium-webdriver

解决方案


推荐阅读