Package org.openqa.selenium

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


    public String login(String url) {
        String sessionId;
        WebDriver driver = null;
        try {
            driver = new HtmlUnitDriver();
            driver.navigate().to(url);

            WebElement form = driver.findElement(By.id("oauth_form"));
            WebElement userField = form.findElement(By.id("username_or_email"));
            WebElement passwordField = form.findElement(By.id("password"));
View Full Code Here


        Timeouts timeouts = mock(Timeouts.class, isProxyable);

        // then
        try {
            driver.manage();
            driver.navigate();
            driver.switchTo();
            driver.findElement(By.className(""));
            driver.findElements(By.className(""));
            driver.getWindowHandles();
View Full Code Here

      url = makeUniqueUrlToAvoidIECaching(url, System.nanoTime());
    }

    try {
      WebDriver webdriver = getAndCheckWebDriver();
      webdriver.navigate().to(url);
      collectJavascriptErrors((JavascriptExecutor) webdriver);
    } catch (WebDriverException e) {
      e.addInfo("selenide.url", url);
      e.addInfo("selenide.baseUrl", baseUrl);
      throw e;
View Full Code Here

    System.out.printf("now accesss %s \n", secondUrl);
    dr.get(secondUrl);
    Thread.sleep(1000);

    System.out.printf("now back to  %s \n", firstUrl);
    dr.navigate().back();
    Thread.sleep(1000);
   
    System.out.printf("forward to  %s \n", secondUrl);
    dr.navigate().forward();
    Thread.sleep(1000);
View Full Code Here

    System.out.printf("now back to  %s \n", firstUrl);
    dr.navigate().back();
    Thread.sleep(1000);
   
    System.out.printf("forward to  %s \n", secondUrl);
    dr.navigate().forward();
    Thread.sleep(1000);
   
    System.out.println("browser will be close");
    dr.quit()
  }
View Full Code Here

//    选择所有的checkbox并全部勾上
    List<WebElement> checkboxes = dr.findElements(By.cssSelector("input[type=checkbox]"));
    for(WebElement checkbox : checkboxes) {
      checkbox.click();
    }
    dr.navigate().refresh();
   
//    打印当前页面上有多少个checkbox
    System.out.printf("%d\n", checkboxes.size());
   
//    选择页面上所有的input,然后从中过滤出所有的checkbox并勾选之
View Full Code Here

       

        SignalCreator sc = new SignalCreator(t.getZuluData());
        sc.createFile(path + "SIGNAL.CSV");
       
        driver.navigate().refresh();
        Thread.sleep(60000);
       
      } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
View Full Code Here

      url = makeUniqueUrlToAvoidIECaching(url, System.nanoTime());
    }

    try {
      WebDriver webdriver = getAndCheckWebDriver();
      webdriver.navigate().to(url);
      collectJavascriptErrors((JavascriptExecutor) webdriver);
    } catch (WebDriverException e) {
      e.addInfo("selenide.url", url);
      e.addInfo("selenide.baseUrl", baseUrl);
      throw e;
View Full Code Here

            final URI baseUri = getBaseURI(before.getTestMethod());
            final WebDriver driver = createWebDriver();
            try {
                driver.manage().deleteAllCookies();

                driver.navigate().to(baseUri + USER_LOGIN_SERVLET_PATH + "?location=" + URLEncoder.encode(userIsLoggedIn.location(), "UTF-8"));
                String loginURL = driver.findElement(By.id("login-url")).getText();

                // check
                if (isInternalLink(loginURL)) {
                    loginURL = baseUri + loginURL;
View Full Code Here

                // check
                if (isInternalLink(loginURL)) {
                    loginURL = baseUri + loginURL;
                }
                // go-to login page
                driver.navigate().to(loginURL);
                // find custom login handler, if exists
                LoginHandler loginHandler = TestBase.instance(getClass(), LoginHandler.class);
                if (loginHandler == null) {
                    loginHandler = new DefaultLoginHandler();
                }
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.