码迷,mamicode.com
首页 > 编程语言 > 详细

java+selenium3学习之一启动firefox浏览器

时间:2017-08-08 15:16:41      阅读:1535      评论:0      收藏:0      [点我收藏+]

标签:print   web   ref   imp   set   sso   timeout   org   tools   

package ceshi.com.lessons;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class LuanchFirefox {


public static void main(String[] args) {
System.setProperty ( "webdriver.firefox.bin" , "D:/Program Files (x86)/Mozilla Firefox/firefox.exe" );
System.setProperty("webdriver.gecko.driver", ".\\Tools\\geckodriver.exe");
WebDriver dr=new FirefoxDriver();
dr.manage().window().maximize();
dr.manage().timeouts().implicitlyWait(8, TimeUnit.SECONDS);
dr.get("http://www.baidu.com");
System.out.println("当前打开页面的标题是:" + dr.getTitle());
dr.quit();
}

}

java+selenium3学习之一启动firefox浏览器

标签:print   web   ref   imp   set   sso   timeout   org   tools   

原文地址:http://www.cnblogs.com/51testing/p/7306582.html

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