Package org.openqa.selenium

Examples of org.openqa.selenium.WebDriver.quit()


  public static void main(String[] args) {
    WebDriver dr = new ChromeDriver();
    System.out.println("browser will be closed");
   
    dr.quit()
    System.out.println("browser is closed");
  }

}
View Full Code Here


    ((JavascriptExecutor)dr).executeScript("$(arguments[0]).fadeOut();", button);
     
   
    Thread.sleep(1000);
    System.out.println("browser will be close");
    dr.quit()
  }

}
View Full Code Here

//    ����2: ֱ�Ӷ�λlink
    dr.findElement(By.linkText("Home")).click();
   
    Thread.sleep(1000);
    System.out.println("browser will be close");
    dr.quit()
  }

}
View Full Code Here

      }
    }
   
    Thread.sleep(1000);
    System.out.println("browser will be close");
    dr.quit()
  }

}
View Full Code Here

//    clear
    element.clear();
   
    Thread.sleep(1000);
    System.out.println("browser will be close");
    dr.quit()
  }

}
View Full Code Here

    dr.switchTo().frame("f1");
    dr.findElement(By.linkText("click")).click();
   
    Thread.sleep(1000);
    System.out.println("browser will be close");
    dr.quit()
  }

}
View Full Code Here

            // If webdriver is running quit.
            WebDriver driver = getDriver();
            if (driver != null) {
                try {
                    log.info("Quitting webdriver.");
                    driver.quit();
                } catch (Throwable e) {
                    // Ignoring driver tear down errors.
                }
            }
            if (driverService != null && driverService.isRunning()) {
View Full Code Here

        List<WebElement> results = driver.findElements(By.className("g"));

        screenSnapper.createSnapAndThumbnail(results);

        driver.quit();
    }
}
View Full Code Here

        getPage().evaluateJavascript("$('#firstname').focus();");

        Boolean jqueryInjected = (Boolean) getPage().evaluateJavascript("return (typeof jQuery === 'function')");
        assertThat(jqueryInjected, is(true));

        driver.quit();
    }

    @Test
    public void should_be_able_to_use_the_javascript_executor_with_parameters() {
        getPage().evaluateJavascript("$('#firstname').focus();", "#firstname");
View Full Code Here

        WebDriver d = getDriver();
        d.get(url + "?session1=value1");
        // Grab set of session cookies
        firstSessionCookies = d.manage().getCookies();
        // Manually quit the current Driver and create a new one
        d.quit();

        // Create second Driver, and grab it's cookies
        prepareDriver();
        d = getDriver();
        d.get(url + "?session2=value2");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.