无法解决webDriver Android Studio

时间:2019-06-18 09:20:03

标签: java android

下面是代码。

 public void waitForWebavailability() throws Exception {
    boolean success = false;
    long waitTime = 0;
    while (!success) {
        try {
            waitTest(30000);
            waitTime += 30000;
            if (waitTime > 600000) {

                System.out.println("Web page is not available");
            }
            webDriver.get("http://www.google.com");
            if (webDriver.getTitle().toLowerCase().contains("sometitle")) {
                success = true;
            }
        } catch (Exception e) {
            success = false;
        }

    }

 }

// Code related to waittest 
 public void waitTest(long millis) throws Exception {
    try {
        Thread.sleep(millis);
    } catch (InterruptedException e) {
        throw new Exception(e);
    }
 }

Android Studio无法解析webDriver行。

0 个答案:

没有答案