章节九、4-ChromDriver介绍
一、首先下载Chrom浏览器驱动,将驱动解压到存放火狐浏览器驱动文件路径中(请观看前面的章节)
1、进入该网址下载匹配本地浏览器版本的驱动
http://chromedriver.storage.googleapis.com/index.html


2、解压文件

二、演示代码
package basicweb; import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver; public class ChromDriverDemo { public static void main(String[] args) { // 定义一个变量来存放网址
String url = "https://www.baidu.com/";
System.setProperty("webdriver.chrome.driver", "D:\\WorkSpace_person\\Selenium\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get(url);
}
}
三、ChromeDriver 是 google 为网站开发人员提供的自动化测试接口,它是 selenium和 chrome浏览器 进行通信的桥梁。selenium 通过一套协议和 ChromeDriver 进行通信,selenium 实质上是对这套协议的底层封装,同时提供外部 WebDriver 的上层调用类库。
章节九、4-ChromDriver介绍的更多相关文章
- 章节九、3-Desired Capabilities介绍
一.Desired Capabilities是selenium webdrive中已经写好的一个类,我们可以通过它来告诉selenium webdrive在Desired Capabilities是什 ...
- 应用程序框架实战二十九:Util Demo介绍
上文介绍了我选择EasyUi作为前端框架的原因,并发放了最新Demo.本文将对这个Demo进行一些介绍,以方便你能够顺利运行起来. 这个Demo运行起来以后,是EasyUi的一个简单CRUD操作,数据 ...
- Maven学习(九)插件介绍
我们都知道Maven本质上是一个插件框架,它的核心并不执行任何具体的构建任务,所有这些任务都交给插件来完成,例如编译源代码是由maven-compiler-plugin完成的.进一步说,每个任务对应了 ...
- 章节九、5-IE Driver
一.下载IE浏览器驱动,然后解压到存放谷歌和火狐驱动的相同路径中(请观看前面的章节) 下载地址一:http://selenium-release.storage.googleapis.com/inde ...
- 章节十一、1-Junit介绍
一.Junit是一个开源的测试框架,在selenium的jar包中,不需要单独安装和搭建环境 二.@BeforeClass:当在方法上加了这个注解的话,这个方法会在这个类的第一个test方法之前运行. ...
- 【ASP.NET Core快速入门】(九) RoutingMiddleware介绍以及MVC引入
前言 前面我们介绍了使用app.Map来配置路由,但是对于一般不是特别大的项目来说,我们不使用Map来进行路由配置. 配置路由 我们首先需要在Startup.cs文件中的ConfigureServic ...
- 基础篇九:模块介绍(--with-http_stub_status_module)
下面--with 即为编译安装的模块 下面我们来介绍--with-http_stub_status_module此模块 vim /etc/nginx/conf.d/default.conf 然后检查 ...
- 章节九、2-使用firefoxdriver浏览器进行自动化测试
一.演示如何使用火狐浏览器打开“百度” package basicweb; import org.openqa.selenium.WebDriver; import org.openqa.seleni ...
- 章节九、1-Selenium环境配置
一.Selenium环境安装配置,这里使用Selenium WebDriver 3.6.0 1.下载Selenium WebDriver (点击后网站响应比较慢,需要多等等) 2.打开该网址后点击“d ...
随机推荐
- 使用MUI的日期控件引起的探索——HTML5 input类型date属性
我写移动端的页面会用到MUI这个框架,个人觉得挺好用的,有很多实用的UI组件.当然坑还是有的,http://dev.dcloud.net.cn/mui/ui/ MUI官网,有兴趣的小伙伴可以看看 虽然 ...
- [Swift]LeetCode150. 逆波兰表达式求值 | Evaluate Reverse Polish Notation
Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, ...
- [Swift]LeetCode164. 最大间距 | Maximum Gap
Given an unsorted array, find the maximum difference between the successive elements in its sorted f ...
- [Swift]LeetCode300. 最长上升子序列 | Longest Increasing Subsequence
Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Inp ...
- [Swift]LeetCode719. 找出第 k 小的距离对 | Find K-th Smallest Pair Distance
Given an integer array, return the k-th smallest distance among all the pairs. The distance of a pai ...
- NumPy 学习笔记(三)
NumPy 数组操作: 1.修改数组形状 a.numpy.reshape(arr, newshape, order='C') 在不改变数据的条件下修改形状 b.numpy.ndarray.flat 是 ...
- VMware修改为静态ip
选择编辑-虚拟机网路编辑器-NAT模式记录 本机cmd执行命令:ipconfig /all 查看VMnet8的ip地址,跟虚拟机子网ip一个网段 确定. su - root 切换到root用户下 修 ...
- 汉诺塔问题其实很简单 Python 递归经典面试题
话不多说,上代码 1 def hanoi_move(n, source, dest, intermediate): 2 if n >= 1: # 递归出口,只剩一个盘子 3 hanoi_move ...
- Qt之自定义托盘
说起Qt,真是个不错的ui库,不仅仅ui做的好,其他方面也不差,在平台扩展方面也是非常的强大.这篇文章我将会分析下qt的托盘,QSystemTrayIcon是qt的托盘类,托盘类的用途是什么我就不说了 ...
- 【Discuz】关于出现“对不起,您安装的不是正版应用..”的解决方法
使用Discuz!建站的站长都会遇到这样的问题:有些插件和风格在安装时出现不能安装的现象,出现以下提示: 不起,您安装的不是正版应用,安装程序无法继续执行 点击这里安装正版应用 针对这一情况,本人从网 ...