WebDriverBackedSelenium: confirmation handling throws: UnsupportedOperationException
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?
精彩评论