- Selenium WebDriver Quick Start Guide
- Pinakin Chaubal
- 74字
- 2021-06-24 18:26:28
Creating the first script
Type the following code. What the following script does is simply opens a new Chrome browser and navigates to the URL http://www.google.com:
public class FirstTest {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver",
"C:\\SeleniumWD\\src\\main\\resources\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://www.google.com");
}
}
Right-click the file and click Run as Java Application and hurrah! A chrome browser opens and http://www.google.com gets loaded.
You have successfully created your first Selenium Script.
推薦閱讀
- Ansible權威指南
- 深入Linux內核架構與底層原理(第2版)
- Kubernetes從入門到實踐
- Instant Optimizing Embedded Systems using Busybox
- Windows 7案例教程
- 操作系統分析
- Linux網絡操作系統項目教程(RHEL 7.4/CentOS 7.4)(第3版)(微課版)
- Hadoop Real-World Solutions Cookbook
- Linux系統安全:縱深防御、安全掃描與入侵檢測
- Azure Resource Manager Templates Quick Start Guide
- 再也不踩坑的kubernetes實戰指南
- Mastering Eclipse Plug-in Development
- Linux指令從初學到精通
- Mastering AWS CloudFormation
- Apache ShardingSphere權威指南