package com.gloryroad.Demo;
import java.io.File;
import java.io.IOException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.internal.ProfilesIni;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class PersonTest {
String url="http://www.sogou.com";
public WebDriver driver;
@BeforeMethod
public void setUp(){
}
@AfterMethod
public void tearDown(){
driver.close();
}
@Test
public void PersonTest() throws IOException{
//
ProfilesIni pro=new ProfilesIni();
//
FirefoxProfile fox=new FirefoxProfile();
fox.addExtension(new File("C:\\Doload\\firebug.xpi"));//这个是firebug的路径,注意版本要对应
fox.setPreference("browser.startup.homepage",url);
driver=new FirefoxDriver(fox);
}
}
火狐启动的时候加载firebug的代码
原创wx5e6caa8b9792d 博主文章分类:Java编程 ©著作权
©著作权归作者所有:来自51CTO博客作者wx5e6caa8b9792d的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
有趣的CSS - 加载的圆
由4个圆组成的一个小清新的动态加载动画效果。
css 加载动画 loading 圆点加载 ux -
有趣的CSS - 文字加载动画效果
用 css 实现多字符模拟加载动画效果。
css 加载动画 交互 ux 动效 -
设置firebug自动启动
about:configextensions.firebug.allPagesActivation;on
设置firebug自动启动 firebug -
初识Firebug 全文 — firebug的使用
初识Firebug 全文 — firebug的使用什么是Firebug 从事了数年的Web开发
CSS HTML javascript