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. A -- HDU 4585 Shaolin

    Shaolin Time Limit: 1000 MS Memory Limit: 32768 KB 64-bit integer IO format: %I64d , %I64u Java clas ...

  2. springMVC图片文件上传功能的实现

    在工程依赖库下添加文件上传jar包 commons-fileupload-1.2.2.jar commons-io-2.4.jar 2.jsp页面设置form表单属性enctype 在表单中上传图片时 ...

  3. python函数和常用模块(二),Day4

    内置函数2 装饰器 字符串格式化 生成器 迭代器 递归 模块 序列化相关 time模块 datetime模块 内置函数2 callable() # 是否可以被执行,是否可以被调用 chr() # as ...

  4. IFeatureCursor.Flush

    IFeatureCursor.Flush Method Flush any outstanding buffered writes to the database. [Visual Basic .NE ...

  5. Mybatis学习记录(八)----Mybatis整合Spring

    1.整合思路 需要spring通过单例方式管理SqlSessionFactory. spring和mybatis整合生成代理对象,使用SqlSessionFactory创建SqlSession.(sp ...

  6. ArcGIS 10 SP5中文版(ArcGIS10补丁5中文版)

    下载地址:百度网盘下载地址:http://pan.baidu.com/s/1o7qPGhk 来自:http://zhihu.esrichina.com.cn/?/sort_type-new__day- ...

  7. 【转】提高C#编程水平的50个要点

    1.总是用属性 (Property) 来代替可访问的数据成员2.在 readonly 和 const 之间,优先使用 readonly3.在 as 和 强制类型转换之间,优先使用 as 操作符4.使用 ...

  8. WKWebView API精讲(OC)

    WKWebView API精讲(OC) 前言 鉴于LL同志对笔者说:“能不能写个OC版本的WKWebView的使用教程?”,还积极打赏了30RMB,笔者又怎么好意思拒绝呢,于是才有了下文. 所有看到本 ...

  9. WebRTC for UWP

    首先还是简单的介绍下webRTC吧: WebRTC,名称源自网页实时通信(Web Real-Time Communication)的缩写,是一个支持网页浏览器进行实时语音对话或视频对话的技术,是谷歌2 ...

  10. iptables基本操作

    一.基本操作 #启动防火墙 service iptables start #停止防火墙 service iptables stop #重启防火墙 service iptables restart #查 ...