内容简介
Selenium和WebDriver工具篇
第1章 自动化测试基础
1.1 初识自动化测试
1.1.1 自动化测试是什么
1.1.2 常见的自动化测试架构
1.1.3 自动化测试的基本流程
1.1.4 自动化测试脚本分类
1.1.5 走出自动化测试认知的误区
1.2 开源Web自动化测试
1.2.1 是否选择开源自动化测试
1.2.2 使用开源自动化测试工具的优势
第2章 Selenium简介和基础
2.1 Selenium简介
2.1.1 Selenium组件
2.1.2 Selenium发展历程
2.1.3 Selenium浏览器支持情况
2.2 Selenium基础
2.2.1 Selenium命令——Selenese
2.2.2 Selenium脚本语法
2.2.3 Selenium测试案例集
2.2.4 常用的Selenium命令
2.3 小结
第3章 Selenium IDE
3.1 Selenium IDE简介
3.1.1 安装Selenium IDE
3.1.2 运行Selenium IDE
3.2 Selenium IDE的操作接口
3.2.1 菜单栏
3.2.2 工具栏
3.2.3 测试案例面板
3.2.4 Log、Reference、UI-Element和Rollup面板
3.3 测试案例和测试案例集
3.3.1 创建测试案例
3.3.2 运行测试案例
3.3.3 调试测试案例
3.3.4 测试案例集
3.4 Selenium IDE功能扩展
3.4.1 用户扩展
3.4.2 转换代码形式
3.5 常见错误处理
第4章 Selenium命令
4.1 验证页面元素
4.2 定位页面元素
4.3 文字模板匹配
4.4 命令使用技巧
4.5 警告框、弹出框以及多窗口
第5章 Selenium1.0 (Selenium RC)
5.1 Selenium 1.0 (Selenium RC)简介
5.2 Selenium RC基础
5.2.1 Selenium RC工作原理
5.2.2 Selenium RC架构
5.2.3 Selenium RC安装
5.3 使用Selenium RC
5.3.1 从Selenese到测试程序
5.3.2 构建你的测试程序
5.3.3 学习Selenium RC API
5.3.4 报告测试结果
5.3.5 为测试加入一些编程逻辑
5.3.6 Server选项
5.3.7 Selenium Server日志记录
5.3.8 处理HTTPS和安全弹出对话框
5.3.9 支持其他浏览器和浏览器配置
5.4 常见错误处理
第6章 Selenium测试案例设计
6.1 测试设计导言
6.2 测试什么
6.3 验证结果
6.3.1 断言vs.验证
6.3.2 权衡:assertTextPresent、assert ElementPresent、assertText
6.4 选择一个定位策略
6.4.1 定位动态对象
6.4.2 如何避免在测试中使用复杂的XPath表达式
6.5 测试AJAX应用系统
6.6 封装Selenium通用函数
6.7 UI映射
6.8 Page Object设计模式
6.9 数据驱动测试
6.10 数据库验证
第7章 Selenium用户扩展
7.1 Selenium用户扩展简介
7.2 Action
7.3 Accessor/Assertion
7.4 定位策略
7.5 在Selenium IDE中使用用户扩展
7.6 在Selenium RC中使用用户扩展
第8章 Selenium Grid
8.1 Selenium Grid是什么
8.2 什么时候使用Selenium Grid
8.3 Selenium Grid如何工作——通过中心和节点
8.3.1 安装Selenium Grid
8.3.2 启动Selenium Grid
8.3.3 通过Selenium Grid运行测试
8.4 Selenium Grid配置
8.4.1 中心(hub)配置
8.4.2 节点(Node)配置
8.5 中心(hub)诊断信息
8.6 常见错误
第9章 Selenium 2.0和WebDriver
9.1 WebDriver基础
9.1.1 WebDriver如何驱动浏览器
9.1.2 WebDriver和Selenium Server
9.1.3 建立Selenium WebDriver工程
9.1.4 从Selenium RC迁移到Selenium WebDriver
9.1.5 常见问题
9.1.6 Selenium WebDriver API简介
9.1.7 Selenium WebDriver API命令和参数
9.2 WebDriver的各种实现
9.2.1 HtmlUnit Driver
9.2.2 Firefox Driver
9.2.3 Internet Explorer Driver
9.2.4 Chrome Driver
9.2.5 其他Driver
9.3 可选的向后相容:混用WebDriver和RC技术
9.3.1 基于WebDriver的Selenium RC
9.3.2 使用Selenium扩展WebDriver
9.4 WebDriver的高级用法
9.4.1 显式和隐式等待
9.4.2 远程WebDriver (Remote WebDriver)
9.4.3 高级用户交互
9.4.4 改变浏览器代理
第10章 Cucumber和WebDriver
10.1 Cucumber基础
10.1.1 下载安装Cucumber
10.1.2 五分钟入门
10.2 Cucumber与WebDriver结合
10.3 采用中文描述的自动化测试
自动化测试实战篇
第11章 实战——测试Google Gmail
11.1 明确测试范围
11.2 Selenium测试——登录Gmail邮箱
11.2.1 使用Selenium IDE录制脚本
11.2.2 转换脚本语言(Java Selenium RC)
11.3 Selenium测试——撰写邮件
11.3.1 使用Selenium IDE录制脚本
11.3.2 转换脚本语言(Java Selenium RC)
11.4 Selenium测试——删除邮件以及邮件列表
11.4.1 使用Selenium IDE录制脚本
11.4.2 转换脚本语言(Java Selenium RC)
11.5 Selenium测试——邮件存档
11.5.1 使用Selenium IDE录制脚本
11.5.2 转换脚本语言(Java Selenium RC)
11.6 Selenium测试——搜索邮件
11.6.1 使用Selenium IDE录制脚本
11.6.2 转换脚本语言(Java Selenium RC)
11.7 使用测试案例集来管理Selenium IDE脚本
11.8 留给读者的思考
第12章 实战——测试Test Perfect
12.1 明确测试范围
12.2 WebDriver测试——添加移动设备
12.2.1 通过Ruby脚本驱动WebDriver
12.2.2 将Cucumber和WebDriver结合
12.3 WebDriver测试——新建测试用例
12.4 WebDriver测试——测试用例运行
12.5 留给读者的思考
Selenium使用帮助篇
第13章 Selenium使用帮助
13.1 Selenium客户端驱动配置
13.1.1 .NET客户端驱动配置
13.1.2 Java客户端驱动配置
13.1.3 Python客户端驱动配置
13.2 使用Maven导入Selenium 2.0工程
13.2.1 使用Maven导入Selenium 2.0工程到Eclipse
13.2.2 使用Maven导入Selenium 2.0工程到IntelliJ