码迷,mamicode.com
首页 > 其他好文 > 详细

打开浏览器操作

时间:2014-07-11 18:03:15      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:style   blog   java   color   for   io   

 1 /*
 2  * 打开浏览器
 3  */
 4 public class OpenBrowsers {
 5 
 6     public static void main(String[] args) {    
 7         // 打开默认路径的 firefox
 8         //WebDriver driver = new FirefoxDriver();
 9         
10         // 打开指定路径的 firefox
11         //System.setProperty("webdriver.firefox.bin", "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");
12         //WebDriver dr = new FirefoxDriver();
13         
14         // 打开指定的 chrome; "E:\\Selenium_New\\JavaForSeleniumLearning\\chromedriver.exe"  chromedriver.exe 需从 selenium 下载
15         //System.setProperty("webdriver.chrome.driver", "E:\\Selenium_New\\JavaForSeleniumLearning\\chromedriver.exe");
16         //WebDriver dr = new ChromeDriver();
17         
18         System.setProperty("webdriver.chrome.bin","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"); 
19         WebDriver driver = new ChromeDriver();
20     }
21 
22 }

 

打开浏览器操作,布布扣,bubuko.com

打开浏览器操作

标签:style   blog   java   color   for   io   

原文地址:http://www.cnblogs.com/Roger1227/p/3833675.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!