Selenium之firefox浏览器的启动
1、编写如下代码
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver; /**
* Created by Administrator on 2018/3/29 0029.
*/
public class FirefoxTest {
public static void main(String[] args){
WebDriver driver;
//启动找不到firefox才需要设置
System.setProperty("webdriver.firefox.bin","D:\\ztsoft\\Firefox\\firefox.exe");
//实例化一个对象firefox
driver = new FirefoxDriver();
String testUrl = "http://www.baidu.com";
driver.get(testUrl);
driver.quit();
}
2、执行代码,弹出firefox,地址栏输入代码设置的地址。
Selenium之firefox浏览器的启动的更多相关文章
- Selenium之firefox浏览器的启动问题及解决
启动firefox报错如下: rg.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 ...
- Selenium驱动Firefox浏览器
用Maven构建Selenium依赖: <dependency> <groupId>org.seleniumhq.selenium</groupId> <ar ...
- 解决Selenium与firefox浏览器版本不兼容问题
因为在用java打开firefox浏览器的时候报错 org.openqa.selenium.firefox.NotConnectedException: Unable to connect to ho ...
- 【selenium】- 常见浏览器的启动
本文由小编根据慕课网视频亲自整理,转载请注明出处和作者. 1. Firefox启动 webdriver自带了firefox浏览器的驱动,所以不需要设置它的驱动. 如果firefox没有安装在默认路径, ...
- Selenium Webdriver firefox 浏览器问题
Selenium Webdriver 在使用firefox 测试会牵扯到firefox的安装路径的问题 1.默认安装路径在c盘的情况下: WebDriver driver = new FirefoxD ...
- Selenium之IE浏览器的启动问题及解决
前面有篇文章说到启动IE浏览器时,会出现以下错误提示: 浏览器启动之后,页面不会自动输入代码设置的地址,如下图展示 查看报错语句,发现原来是浏览器比例调的不正确,修改浏览器比例为100%即可解决该问题
- Selenium之Chrome浏览器的启动问题及解决
System.setProperty("webdriver.chrome.driver","chromedriver.exe路径"); 配置好Chrome的驱动 ...
- Selenium之IE浏览器的启动
1.下载IEDriverServer.exe文件放至需要的目录中: 2.编写代码 import org.openqa.selenium.WebDriver; import org.openqa.sel ...
- Selenium之Chrome浏览器的启动
1.下载Chromedriver.exe文件放至需要的目录中: 2.编写代码 import org.openqa.selenium.WebDriver; import org.openqa.selen ...
随机推荐
- NHibernate实例
1. 下载相关资源: 下载NHibernate.下载地址: http://nhforge.org/Default.aspx 下载微软Northwind示例数据库,下载地址:http://www.mic ...
- ADO.net方法
using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; usin ...
- 更改VS2010的[默认开发语言]
1.菜单-->"工具"-->"导入导出设置".例如以下图: 2.选择"重置全部设置",例如以下图: 3.重置设置,例如以下图: ...
- Java类的设计----Object 类
Object类 Object类是所有Java类的根父类如果在类的声明中未使用extends关键字指明其父类,则默认父类为Object类 public class Person { ... } 等价于: ...
- shell基础篇(一)从hello world开始
前记:这里是我做的shell笔记:接下来会提供一系列. Shell是一种脚本语言,那么,就必须有解释器来执行这些脚本.Unix/Linux上常见的Shell脚本解释器有bash.sh.csh.ksh等 ...
- java 字符编码问题
编写一个截取字符串的函数,输入为一个字符串和字节数,输出为按字节截取的字符串.但是要保证汉字不被截半个,如“我ABC”4,应该截为“我AB”,输入“我ABC汉DEF”,6,应该输出为“我ABC”而不是 ...
- PHP-CGI 进程 CPU 100% 与 file_get_contents 函数的关系
[文章作者:张宴 本文版本:v1.0 最后修改:2011.08.05 转载请注明原文链接:http://blog.s135.com/file_get_contents/] 有时候,运行 Nginx.P ...
- Docker源码分析(五):Docker Server的创建
1.Docker Server简介 Docker架构中,Docker Server是Docker Daemon的重要组成部分.Docker Server最主要的功能是:接受用户通过Docker Cli ...
- PHP中new static()与new self()的区别异同
self - 就是这个类,是代码段里面的这个类. static - PHP 5.3加进来的只得是当前这个类,有点像$this的意思,从堆内存中提取出来,访问的是当前实例化的那个类,那么 static ...
- 【BZOJ4698】Sdoi2008 Sandy的卡片 后缀数组+RMQ
[BZOJ4698]Sdoi2008 Sandy的卡片 Description Sandy和Sue的热衷于收集干脆面中的卡片.然而,Sue收集卡片是因为卡片上漂亮的人物形象,而Sandy则是为了积攒卡 ...