1、火狐浏览器

    /*
* 初始化火狐浏览器
* */
public static WebDriver initFireFox(WebDriver dr) { String key = "webdriver.firefox.bin";
String value = "C:/Program Files (x86)/Mozilla Firefox/firefox.exe";
System.setProperty(key, value);
dr = new FirefoxDriver();
dr.manage().window().maximize();
dr.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); return dr; }

2、ie浏览器

    /*
* 初始化IE浏览器
* */
public static WebDriver initIE(WebDriver dr) { String key = "webdriver.ie.driver";
String value = "./other/IEDriverServer.exe";
System.setProperty(key, value);
dr = new InternetExplorerDriver();
dr.manage().window().maximize();
dr.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); return dr; }

3.chrome浏览器

    /*
* 初始化谷歌浏览器
* */
public static WebDriver initChrome(WebDriver dr) { String key = "webdriver.chrome.driver";
String value = "./other/chromedriver.exe";
System.setProperty(key, value);
dr = new ChromeDriver();
dr.manage().window().maximize();
dr.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); return dr; }

selenium如何分别启动IE、firefox、chrome浏览器的更多相关文章

  1. Python+selenium 自动化-启用带插件的chrome浏览器,调用浏览器带插件,浏览器加载配置信息。

    Python+selenium 自动化-启用带插件的chrome浏览器,调用浏览器带插件,浏览器加载配置信息.   本文链接:https://blog.csdn.net/qq_38161040/art ...

  2. 如何禁用Firefox,chrome浏览器“不安全密码警告”

    在任何HTTP页面中,一个全新的“不安全密码警告”将会在用户点击表单时直接出现在登陆框的下方,强行保证所有用户都能看到“此链接不安全,你的个人利益将受到损害”等字眼,同时整个页面也会收到损坏的挂锁图标 ...

  3. [Selenium] 如何在老版本的Chrome 浏览器上使用selenium

    由于Chrome Driver 只兼容Chrome  浏览器12.0.712.0 和之后的新版本,会因此如果要在老版本的Chrome  浏览器上使用Selenium, 则只能使用 SeleniumRC ...

  4. 【转载】linux环境下为firefox/chrome浏览器安装flash player

    本文转载自 http://blog.sina.com.cn/s/blog_6ad624380102v1xf.html     firefox安装flash player的方法: 先到adobe网站上下 ...

  5. 修改firefox/chrome浏览器的UserAgent

    Firefox: about:config ---> useragent ---> general.useragent.override -> DIY_AGENT Chrome: 创 ...

  6. tomcat启动之后,Chrome浏览器可以访问,IE不行(IE无法访问8080 端口)

    方法简单粗暴,在windows中关闭IE服务,然后再重新安装服务. 请注意,在输入框输入:  http://localhost:8080/myproject 不要直接输入localhost:8080/ ...

  7. 爬虫动态渲染页面爬取之selenium驱动chrome浏览器的使用

    Selenium是一个用于Web应用程序测试的工具.Selenium测试直接运行在浏览器中,就像真正的用户在操作一样,可以用其进行网页动态渲染页面的爬取. 支持的浏览器包括IE(7, 8, 9, 10 ...

  8. Selenium2学习-006-WebUI自动化实战实例-004-解决 Chrome 浏览器证书提示:--ignore-certificate-errors

    此文主要讲述 Java 运行 Selenium 脚本时,如何消除 Chrome 浏览器启动后显示的证书错误报警提示,附带 Chrome 参数使浏览器最大化的参数. 希望能对初学 Selenium2 W ...

  9. selenium webdriver 启动三大浏览器Firefox,Chrome,IE

    selenium webdriver 启动三大浏览器Firefox,Chrome,IE 1.安装selenium 在联网的情况下,在Windows命令行(cmd)输入pip install selen ...

随机推荐

  1. yii2时间日期控件的使用[转]

    注:原文http://www.manks.top/yii2-datetimepicker.html 有更改 1.安装 进入到项目文件中D:\phpStudy\WWW\yii2blog    使用cmd ...

  2. Android 手机卫士16--手机杀毒

    1.指定动画一直旋转 rotateAnimation.setRepeatCount(RotateAnimation.INFINITE); android:repeatCount 重复的次数,默认为0, ...

  3. 使用 Canvas 和 JavaScript 创建逼真的下雨效果

    HTML5 规范引进了很多新特性,其中最令人期待的之一就是 Canvas 元素,HTML5 Canvas 提供了通过 JavaScript 绘制图形的方法,非常强大.这里向大家展示一个使用 Canva ...

  4. CSS基础选择器温故-1

    1.基本选择器语法 2.浏览器兼容性:浏览器对基本选择器都是一路绿灯通行,可以放心使用. 3.通配选择器:选择所有元素,也可以选择某个元素下的所有元素 (1)选择所有元素: *{margin: 0;p ...

  5. 如何解决cellIndex在IE下兼容性问题

    在不久前的项目中,涉及到一个表格数据展示在IE下出现兼容性问题.经过一段时间的排查,居然是一个cellIndex属性导致的. cellIndex表示返回一行的单元格集合中单元格的位置索引. 例子: & ...

  6. 转:NLog之:文件类型目标(File target)

    转:http://www.cnblogs.com/RitchieChen/archive/2012/07/16/2594308.html 英文原文[http://nlog-project.org/wi ...

  7. SharePoint部署工具SPSD

    SharePoint Solution Deployer,绝对属于必备的SharePoint工具之一了. 下载,解压这个工具,会有如下的目录(没有Assemblies和DeployGAC.bat)解压 ...

  8. Android 自定义带刻度的seekbar

    自定义带刻度的seekbar 1.布局 <span style="font-family:SimHei;font-size:18px;"><com.imibaby ...

  9. [leetcode] Rectangle Area

    Rectangle Area Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectang ...

  10. java 之 file类的一些方法

    File类: File类是java.io包下代表与平台无关的文件和目录,也就是说,如果希望在程序中操作文件和目录,都可以通过File类来完成.但是File不能访问文件内容本身. 访问文件和目录: 1. ...