直到Selenium 3中弃用

时间:2018-07-18 09:15:51

标签: selenium

我刚从2.43迁移到3.13我的硒。

我的一段代码:

我的构造函数具有以下内容。现在,我在直到函数上出错。如何解决此问题。.我已经从旧文件中复制了guava-15.0,但仍然无法正常工作..有什么办法可以添加流利的等待而没有太多痛苦?或者我可以使其工作直到功能?

public MyAlerts() throws IOException {
        try {
            WebDriverWait wait = new WebDriverWait(driver, 90);
            wait.until(ExpectedConditions.visibilityOfElementLocated(welcomeHeader));
            wait.until(ExpectedConditions.visibilityOfElementLocated(welcomeMessage));
            wait.until(ExpectedConditions.visibilityOfElementLocated(addNewAlert));
            wait.until(ExpectedConditions.visibilityOfElementLocated(viewCardDropdown);         
            WelcomeHeader = driver.findElement(welcomeHeader);
            WelcomeMessage = driver.findElement(welcomeMessage);
            AddNewAlert = driver.findElement(addNewAlert);
            ViewCardDropDown = driver.findElement(viewCardDropdown);
            AlertSettingsBanner = driver.findElement(alertsettingsBanner);
            AlertSettings = driver.findElement(alertsettings);
            AlertHistory = driver.findElement(alertHistory);
            LookingForSomething =driver.findElement(lookingforSomethingBlock);
            HelpIcon=driver.findElement(helpIcon);  
            test.pass("Navigated to My Alerts Page",
                    MediaEntityBuilder.createScreenCaptureFromPath(captureScreen()).build());

        } catch (Exception e) {
            test.fail("My Alerts Page Error *********" + ExceptionUtils.getStackTrace(e), MediaEntityBuilder.createScreenCaptureFromPath(captureScreen()).build());
        }
    }

0 个答案:

没有答案