小技巧
非默认安装的火狐浏览器怎么处理?
//打开指定路径的firefox,方法1
System.setProperty("webdriver.firefox.bin","D:\\Program Files\\Mozilla Firefox\\firefox.exe");
//打开指定路径的firefox,方法2(构造方法)
File pathToFirefoxBinary = new File("D:\\Program Files\\Mozilla Firefox\\firefox.exe");
FirefoxBinary firefoxbin = new FirefoxBinary(pathToFirefoxBinary);
driver = new FirefoxDriver(firefoxbin,null);
启动特定Profile的火狐浏览器(含插件)?--(构造方法)
FirefoxProfile profile = new FirefoxProfile(new File(
"\\Firefox\\Profiles\\*******.default"));
driver = new FirefoxDriver(profile);
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!