2

テストで確認ダイアログとアラートを処理するために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」サイトのドキュメントに従いましたが、なぜこのエラーが発生するのかわかりません。何かアイデアはありますか?

4

0 に答える 0