- 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.
推薦閱讀
- Kubernetes修煉手冊
- Linux系統(tǒng)架構(gòu)與運(yùn)維實(shí)戰(zhàn)
- Hands-On DevOps with Vagrant
- Kubernetes網(wǎng)絡(luò)權(quán)威指南:基礎(chǔ)、原理與實(shí)踐
- Implementing Azure DevOps Solutions
- 直播系統(tǒng)開發(fā):基于Nginx與Nginx-rtmp-module
- Android物聯(lián)網(wǎng)開發(fā)細(xì)致入門與最佳實(shí)踐
- AWS Development Essentials
- Windows 7實(shí)戰(zhàn)從入門到精通
- iOS 10 開發(fā)指南
- iOS 10快速開發(fā):18天零基礎(chǔ)開發(fā)一個(gè)商業(yè)應(yīng)用
- 再也不踩坑的kubernetes實(shí)戰(zhàn)指南
- Responsive Web Design with AngularJS
- Responsive Web Design by Example:Beginner's Guide(Second Edition)
- C#實(shí)用教程(第2版)