Package org.openqa.selenium

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


   
    System.out.printf("title of current page is %s\n", dr.getTitle());
    System.out.printf("url of current page is %s\n", dr.getCurrentUrl());
   
    System.out.println("browser will be close");
    dr.quit()
  }

}
View Full Code Here


    WebElement current_page = dr.findElement(By.className("pagination")).findElement(By.className("active"));
    System.out.printf("Current page is %s\n", current_page.getText());
   
    Thread.sleep(1000);
    System.out.println("browser will be close");
    dr.quit()
  }

}
View Full Code Here

//    获取该链接的text
    System.out.println(link.getText());
   
    Thread.sleep(1000);
    System.out.println("browser will be close");
    dr.quit()
  }

}
View Full Code Here

    Alert alert = dr.switchTo().alert();
    alert.accept();
           
    Thread.sleep(1000);
    System.out.println("browser will be close");
    dr.quit()
  }

}
View Full Code Here

    List<WebElement> allCheckboxes = dr.findElements(By.cssSelector("input[type=checkbox]"));
    allCheckboxes.get(allCheckboxes.size() - 1).click();
   
    Thread.sleep(1000);
    System.out.println("browser will be close");
    dr.quit()
  }

}
View Full Code Here

    System.out.println("maximize browser");
    dr.manage().window().maximize();
    Thread.sleep(2000);
   
    System.out.println("browser will be close");
    dr.quit()
  }

}
View Full Code Here

//    by xpath
    dr.findElement(By.xpath("/html/body/form/div[3]/div/label/input")).click();
    Thread.sleep(1000);
   
    System.out.println("browser will be close");
    dr.quit()
  }

}
View Full Code Here

//    SendKeys to A
    dr.findElement(By.id("A")).sendKeys(Keys.chord("watir webdriver is better than selenium webdriver"));
   
    Thread.sleep(1000);
    System.out.println("browser will be close");
    dr.quit()
  }

}
View Full Code Here

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

}
View Full Code Here

    WebElement link = dr.findElement(By.id("myModal")).findElement(By.id("click"));
    ((JavascriptExecutor)dr).executeScript("$(arguments[0]).click()", link);
   
    Thread.sleep(1000);
    System.out.println("browser will be close");
    dr.quit()
  }
}
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.