WebDriverBackedSelenium:确认处理抛出:UnsupportedOperationException
我在测试中使用 WebDriverBackedSelenium 处理确认对话框和警报
WebDriver driver = new FirefoxDriver();
driver.get("https://uat03.testnet.com/uat03/main.asp");
Selenium selenium = new WebDriverBackedSelenium(driver,"https://uat03.testnet.com/uat03/main.asp");
WebElement logout = driver.findElement(By.linkText("Logoff"));
logout.click();
selenium.chooseOkOnNextConfirmation();
selenium.getConfirmation();
WebDriver driverInstance = ((WebDriverBackedSelenium) selenium).getUnderlyingWebDriver();
当测试到达:chooseOkOnNextConfirmation();控制台抛出错误:
Exception in thread "main" java.lang.UnsupportedOperationException: getConfirmation
at org.openqa.selenium.WebDriverCommandProcessor.execute(WebDriverCommandProcessor.java:278)
at org.openqa.selenium.WebDriverCommandProcessor.getString(WebDriverCommandProcessor.java:252)
at com.thoughtworks.selenium.DefaultSelenium.getConfirmation(DefaultSelenium.java:429)
at testscripts.Deployment.main(Deployment.java:149)
我已按照“seleniumhq”网站上的文档进行操作,但我不明白为什么它会抛出此错误,有什么想法吗?
I using WebDriverBackedSelenium to handle confirmation dialogues and alerts in my tests
WebDriver driver = new FirefoxDriver();
driver.get("https://uat03.testnet.com/uat03/main.asp");
Selenium selenium = new WebDriverBackedSelenium(driver,"https://uat03.testnet.com/uat03/main.asp");
WebElement logout = driver.findElement(By.linkText("Logoff"));
logout.click();
selenium.chooseOkOnNextConfirmation();
selenium.getConfirmation();
WebDriver driverInstance = ((WebDriverBackedSelenium) selenium).getUnderlyingWebDriver();
When the test reaches the: chooseOkOnNextConfirmation(); the console throws an error:
Exception in thread "main" java.lang.UnsupportedOperationException: getConfirmation
at org.openqa.selenium.WebDriverCommandProcessor.execute(WebDriverCommandProcessor.java:278)
at org.openqa.selenium.WebDriverCommandProcessor.getString(WebDriverCommandProcessor.java:252)
at com.thoughtworks.selenium.DefaultSelenium.getConfirmation(DefaultSelenium.java:429)
at testscripts.Deployment.main(Deployment.java:149)
I have followed the documentation on the "seleniumhq" site and I don't understand why it is throwing this error, any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论