会做饭的吃货 發表於 2020-5-14 09:33:00

Python Web自动化测试入门与实战,从入门到入行

<p><strong>豆瓣高评分读书:</strong></p>
<p><img src="https://img2020.cnblogs.com/blog/1359074/202012/1359074-20201229122512541-1959708914.png" alt="" loading="lazy"></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>本书由一线测试工程师结合工作实践精心编撰。全书基于Python语言,从环境搭建、基础知识、常用框架、项目实战、持续集成等方面详细介绍了Web自动化测试的知识。全书共三篇14章,一篇(1~7章)为基础篇,介绍Python语言基础、Selenium和WebDriver的使用以及两个流行的单元测试框架UnitTest和Pytest;二篇(8章~10章)为实践篇,主要以数据驱动模型和PO模型为例介绍自动化测试项目的流程和应用;三篇(11章~14章)为卓异篇,介绍了测试人员如何拓展自己的知识面、提高项目代码质量的建议以及一些与自动化测试相关的面试题。 本书技术先进,通俗易懂,示例丰富,特别适合于想入行自动化测试岗位的初学者和在校学生,也适合掌握了一定的测试基础知识希望快速提升实战能力的读者使用。</p>
<h2>购买地址</h2>
<h4 style="margin-left: 30px">京东:https://item.jd.com/12656245.html</h4>
<h4 style="margin-left: 30px"><span style="font-size: 1em">当当:</span>http://product.dangdang.com/28551658.html</h4>
<h2>图书信息</h2>
<p><img src="https://img2020.cnblogs.com/blog/1359074/202005/1359074-20200515195932442-1897497876.png" alt="" width="269" height="268"></p>
<div style="margin-left: 30px"><span style="font-size: large"><span>作者:杨定佳</span></span></div>
<div style="margin-left: 30px"><span style="font-size: large"><span>定价:<span>79<span>元<br></span></span></span></span></div>
<p style="margin-left: 30px"><span style="font-size: large"><span>印次:1-1<br><span>ISBN:9787302552956<br><span>出版日期:2020.06.01<br><span>印刷日期:2020.04.23</span></span></span></span></span></p>
<h2><span style="font-size: large"><span>&nbsp;</span></span></h2>
<h2><span style="font-size: large"><span>作者简介</span></span></h2>
<p style="margin-left: 30px"><span style="font-size: large"><span>杨定佳,英文名Tynam,从事软件测试工作多年,目前就职于某外企。在自动化测试设计、框架搭建和开发中具有自己独特的见解。长期在IT博客圈分享软件测试与开发技术相关博文</span></span></p>
<h2 class="1" style="text-align: left" align="center">前&nbsp;&nbsp;&nbsp; 言</h2>
<p class="a0" style="margin-left: 30px">随着互联网的快速发展,软件研发模型越来越完善,软件质量也越来越受到各公司的重视,在这种情况下,软件测试技术特别是自动化测试技术在产品研发过程中扮演了极为重要的角色。自动化测试能够快速、全面地对软件进行测试,从而在保证产品质量的前提下进行软件的快速迭代。与此同时,软件测试岗位吸引了大量从业者。本书正是为满足初入自动化测试行业的从业者的需求而精心编撰。</p>
<p class="a0" style="margin-left: 30px">本书基于Python语言编写,对于Web自动化测试相关技术做了整体详细的介绍,从基础到提升、从理论到实践、从单个知识点到项目运用,既可以让读者快速上手又能够运用于实际项目,从而提高读者的实战技能。</p>
<h3 style="margin-left: 30px">本书结构</h3>
<p class="a0" style="margin-left: 30px">本书内容分为3大篇,共计14章。各部分内容概述如下:</p>
<p class="a0" style="margin-left: 30px">基础篇(第1章~第7章)—自动化测试基础知识。本篇主要讲述自动化测试人员需要掌握的基本知识,从代码使用层面进行介绍,包括Python基础、WebDriver API的使用及单元测试框架等知识。</p>
<p class="a0" style="margin-left: 30px">第1章~第3章是自动化测试的入门知识。第1章为开始自动化工作前的准备工作—环境搭建。第2章和第3章分别介绍Python的使用和WebDriver API的使用,掌握了基础知识后就能够编写一些简单的自动化测试脚本。</p>
<p class="a0" style="margin-left: 30px">第4章~第7章是学习完第1章~第3章入门知识后的进阶知识。第4章和第6章分别介绍了经常使用的两种单元测试框架UnitTest和Pytest,学完单元测试框架便可以对项目有个基本的构思。第5章介绍Selenium Grid分布式执行测试用例(好的项目还需要搭配高速的执行效率)。第7章介绍了Python的一些常用模块。</p>
<p class="a0" style="margin-left: 30px">基础篇主要是为自动化测试实践运用打下牢固的基础,适合初学自动化测试的人员学习。</p>
<p class="a0" style="margin-left: 30px">实践篇(第8章~第10章)—自动化测试项目实战。</p>
<p class="a0" style="margin-left: 30px">实践篇是在掌握了基础篇的基本知识后,在自动化测试项目的应用。从项目层面进行介绍,以数据驱动模型和PO模型为基础进行实战练习,然后进行持续集成操作。</p>
<p class="a0" style="margin-left: 30px">第8章使用数据驱动模型,从项目解析、框架搭建、用例组织、数据操作等几个方面进行介绍,主要使读者对数据驱动模型有一个认识,该模型在实际项目中会被经常使用。</p>
<p class="a0" style="margin-left: 30px">第9章使用PO模型,以一个简单的后台管理系统从项目解析、框架搭建、常用结构封装、页面封装、用例组织、设置项目入口等几个方面进行介绍。很多公司在项目中都会以PO模型为基础,混合数据驱动模型和其他的一些方式进行项目操作,建议读者对本章内容进行深入的学习。</p>
<p class="a0" style="margin-left: 30px">第10章介绍了目前最流行的持续集成工具Jenkins,对第9章产生的项目测试脚本进行持续集成,从项目创建、任务定时、邮件发送等几个方面进行实战应用。</p>
<p class="a0" style="margin-left: 30px">本篇属于项目实践篇,适合具有一定基础的自动化测试人员学习。学完实践篇,在项目解析、自动化框架搭建、模块封装、用例组织、测试报告生成和持续集成上,读者已经有一定程度的认知,由此便可以在中小型项目上进行实际操作。</p>
<p class="a0" style="margin-left: 30px">卓异篇(第11章~第14章)—拓展知识面并提高项目质量。</p>
<p class="a0" style="margin-left: 30px">卓异篇主要用来提高读者的知识面,一个完整的自动化测试项目不只是写好测试脚本,还需要一些辅助的知识技能,本篇将介绍6种测试模型、如何写一手高质量的代码和以GitHub为例讲解Git的基本使用,此外,还介绍了一些初级测试人员求职必备的面试题。</p>
<p class="a0" style="margin-left: 30px">第11章介绍的是5种基本自动化测试模型,即线性模型、模块化驱动模型、数据驱动模型、关键字驱动模型及行为驱动模型。</p>
<p class="a0" style="margin-left: 30px">第12章介绍如何提高自己的编码质量,从编码规范、项目层次结构、个人学习几个方面进行说明。</p>
<p class="a0" style="margin-left: 30px">第13章介绍了一个开源的分布式版本控制系统Git,并以GitHub为例介绍Git命令的使用。</p>
<p class="a0" style="margin-left: 30px">第14章精选了一些常见的自动化测试经典面试题,涵盖Python、Selenium和开放性三个方面,以帮助有求职需求的读者应对面试。</p>
<p class="a0" style="margin-left: 30px">卓异篇旨在拓展知识,不仅适合自动化测试人员,对于从事测试工作的从业者也同样适合。</p>
<h3 style="margin-left: 30px">本书特色</h3>
<p class="a2" style="margin-left: 30px">本书的特点主要体现在以下几方面:</p>
<p class="a" style="margin-left: 30px">l&nbsp; 内容编排循序渐进,从零基础开始到框架结构在项目中应用,针对Web自动化测试新手量身打造。</p>
<p class="a" style="margin-left: 30px">l&nbsp; 知识点全面,涵盖了Web自动化测试体系中的大部分知识点。从基础知识到框架结构、持续集成等都进行了讲解。</p>
<p class="a" style="margin-left: 30px">l&nbsp; 理论与应用结合,知识点讲解中整合了许多示例进行演示说明。</p>
<p class="a" style="margin-left: 30px">l&nbsp; 技术新,本书所讲解的知识都是目前比较流行的,用到的技术比较新。</p>
<p class="a" style="margin-left: 30px">l&nbsp; 代码丰富,实用性和系统性非常强。</p>
<p class="a" style="margin-left: 30px">l&nbsp; 示例代码开源,参考附录可获取开发示例源码。</p>
<p class="a" style="margin-left: 30px">l&nbsp; 项目实战应用,学完基础知识,可以在项目中进行实战练习,即学即用,迅速获得项目经验。</p>
<p class="a" style="margin-left: 30px">l&nbsp; 结合笔者实际经验进行示例讲解。</p>
<p class="a" style="margin-left: 30px">l&nbsp; 扩展性,学完本书后不但会运用本书技术还能够写出高质量的代码,并应对求职面试。</p>
<h3 style="margin-left: 30px">目标读者</h3>
<p class="a2" style="margin-left: 30px">本书主要适合以下读者:</p>
<p class="a" style="margin-left: 30px">l&nbsp; 希望进入自动化测试行业的人员。</p>
<p class="a" style="margin-left: 30px">l&nbsp; 在校学生。</p>
<p class="a" style="margin-left: 30px">l&nbsp; 自动化测试零基础的测试从业者。</p>
<p class="a" style="margin-left: 30px">l&nbsp; 有一定基础希望提升自己的测试从业者。</p>
<p class="a" style="margin-left: 30px">l&nbsp; 培训机构学员。</p>
<p class="a1" style="margin-left: 30px">希望读者通过阅读本书都能够快速进入Web自动化测试领域,对Web自动化测试有一个清晰地理解,并且具备承担Web自动化测试开发的能力。</p>
<p class="a0" style="margin-left: 30px">由于编者水平所限,书中难免存在错误或解释不到位的地方,恳请广大读者批评指正。</p>
<p class="a0" style="margin-left: 30px">联系邮箱:tynam.yang@gmail.com。</p>
<p class="a0" style="margin-left: 30px">2019年12月</p>
<h2>&nbsp;</h2>
<h2><span style="font-size: large"><span>图书目录</span></span></h2>
<p>&nbsp;第一篇&nbsp; 基础篇</p>
<p style="margin-left: 30px">&nbsp;第1章&nbsp; 学习环境的搭建... 1</p>
<p style="margin-left: 30px">&nbsp;1.1&nbsp; 环境搭建... 1</p>
<p style="margin-left: 30px">&nbsp;1.1.1&nbsp; Selenium简介... 2</p>
<p style="margin-left: 30px">&nbsp;1.1.2&nbsp; Python简介... 3</p>
<p style="margin-left: 30px">&nbsp;1.1.3&nbsp; Python的安装... 5</p>
<p style="margin-left: 30px">&nbsp;1.1.4&nbsp; 环境变量的设置... 6</p>
<p style="margin-left: 30px">&nbsp;1.1.5&nbsp; Selenium的安装... 7</p>
<p style="margin-left: 30px">&nbsp;1.1.6&nbsp; 浏览器驱动的安装... 8</p>
<p style="margin-left: 30px">&nbsp;1.1.7&nbsp; PyCharm的安装... 12</p>
<p style="margin-left: 30px">&nbsp;1.2&nbsp; 开始你的第一个项目... 15</p>
<p style="margin-left: 30px">&nbsp;第2章&nbsp; Python基础... 18</p>
<p style="margin-left: 30px">&nbsp;2.1&nbsp; 基础语法... 18</p>
<p style="margin-left: 30px">&nbsp;2.1.1&nbsp; 打印... 18</p>
<p style="margin-left: 30px">&nbsp;2.1.2&nbsp; 编码... 19</p>
<p style="margin-left: 30px">&nbsp;2.1.3&nbsp; 数据类型... 20</p>
<p style="margin-left: 30px">&nbsp;2.1.4&nbsp; 变量... 21</p>
<p style="margin-left: 30px">&nbsp;2.1.5&nbsp; 注释... 21&nbsp;</p>
<p style="margin-left: 30px">2.1.6&nbsp; 缩进... 22</p>
<p style="margin-left: 30px">&nbsp;2.2&nbsp; 运算符... 22</p>
<p style="margin-left: 30px">&nbsp;2.2.1&nbsp; 算术运算符... 22</p>
<p style="margin-left: 30px">&nbsp;2.2.2&nbsp; 比较运算符... 23</p>
<p style="margin-left: 30px">&nbsp;2.2.3&nbsp; 逻辑运算符... 23</p>
<p style="margin-left: 30px">&nbsp;2.2.4&nbsp; Is 与 ==. 24</p>
<p style="margin-left: 30px">&nbsp;2.3&nbsp; 条件语句... 24</p>
<p style="margin-left: 30px">&nbsp;2.3.1&nbsp; 单项判断... 25</p>
<p style="margin-left: 30px">&nbsp;2.3.2&nbsp; 双向判断... 25</p>
<p style="margin-left: 30px">&nbsp;2.3.3&nbsp; 多项判断... 25</p>
<p style="margin-left: 30px">&nbsp;2.4&nbsp; 循环语句... 26</p>
<p style="margin-left: 30px">&nbsp;2.4.1&nbsp; for语句... 26</p>
<p style="margin-left: 30px">&nbsp;2.4.2&nbsp; while语句... 27</p>
<p style="margin-left: 30px">&nbsp;2.4.3&nbsp; continue和break. 28</p>
<p style="margin-left: 30px">&nbsp;2.5&nbsp; 列表... 28</p>
<p style="margin-left: 30px">&nbsp;2.5.1&nbsp; 创建列表... 28</p>
<p style="margin-left: 30px">&nbsp;2.5.2&nbsp; 获取元素... 29</p>
<p style="margin-left: 30px">&nbsp;2.5.3&nbsp; 添加元素... 29</p>
<p style="margin-left: 30px">&nbsp;2.5.4&nbsp; 删除元素... 29</p>
<p style="margin-left: 30px">&nbsp;2.5.5&nbsp; 列表切片... 30</p>
<p style="margin-left: 30px">&nbsp;2.5.6&nbsp; 其他操作... 31</p>
<p style="margin-left: 30px">&nbsp;2.6&nbsp; 元组... 31</p>
<p style="margin-left: 30px">&nbsp;2.6.1&nbsp; 创建元组... 31</p>
<p style="margin-left: 30px">&nbsp;2.6.2&nbsp; 获取元素... 31</p>
<p style="margin-left: 30px">&nbsp;2.6.3&nbsp; 拼接元组... 32</p>
<p style="margin-left: 30px">&nbsp;2.6.4&nbsp; 删除元组... 32</p>
<p style="margin-left: 30px">&nbsp;2.6.5&nbsp; 其他操作... 32</p>
<p style="margin-left: 30px">&nbsp;2.7&nbsp; 字典... 33</p>
<p style="margin-left: 30px">&nbsp;2.7.1&nbsp; 创建字典... 33</p>
<p style="margin-left: 30px">&nbsp;2.7.2&nbsp; 获取元素... 33</p>
<p style="margin-left: 30px">&nbsp;2.7.3&nbsp; 修改元素... 33</p>
<p style="margin-left: 30px">&nbsp;2.7.4&nbsp; 删除元素... 34</p>
<p style="margin-left: 30px">&nbsp;2.7.5&nbsp; 其他操作... 34</p>
<p style="margin-left: 30px">&nbsp;2.8&nbsp; 集合... 34</p>
<p style="margin-left: 30px">&nbsp;2.8.1&nbsp; 创建集合... 35</p>
<p style="margin-left: 30px">&nbsp;2.8.2&nbsp; 添加元素... 35</p>
<p style="margin-left: 30px">&nbsp;2.8.3 &nbsp;移除元素... 35</p>
<p style="margin-left: 30px">&nbsp;2.8.4&nbsp; 其他操作... 36</p>
<p style="margin-left: 30px">&nbsp;2.9&nbsp; 推导式... 36</p>
<p style="margin-left: 30px">&nbsp;2.9.1&nbsp; 列表推导式... 36</p>
<p style="margin-left: 30px">&nbsp;2.9.2&nbsp; 字典推导式... 37</p>
<p style="margin-left: 30px">&nbsp;2.9.3&nbsp; 集合推导式... 37</p>
<p style="margin-left: 30px">&nbsp;2.10&nbsp; 生成器... 38</p>
<p style="margin-left: 30px">&nbsp;2.10.1&nbsp; 创建生成器... 38</p>
<p style="margin-left: 30px">&nbsp;2.10.2&nbsp; send方法... 39</p>
<p style="margin-left: 30px">&nbsp;2.11&nbsp; 迭代器... 40</p>
<p style="margin-left: 30px">&nbsp;2.11.1&nbsp; 可迭代对象... 40</p>
<p style="margin-left: 30px">&nbsp;2.11.2&nbsp; 创建迭代器... 40</p>
<p style="margin-left: 30px">&nbsp;2.12&nbsp; 函数... 41</p>
<p style="margin-left: 30px">&nbsp;2.12.1&nbsp; 函数... 41</p>
<p style="margin-left: 30px">&nbsp;2.12.2&nbsp; 参数... 42</p>
<p style="margin-left: 30px">&nbsp;2.12.3&nbsp; 匿名函数... 45</p>
<p style="margin-left: 30px">&nbsp;2.12.4&nbsp; 参数类型... 45</p>
<p style="margin-left: 30px">&nbsp;2.12.5&nbsp; 返回值类型... 46</p>
<p style="margin-left: 30px">&nbsp;2.13&nbsp; 类和对象... 46</p>
<p style="margin-left: 30px">&nbsp;2.13.1&nbsp; 创建类... 46</p>
<p style="margin-left: 30px">&nbsp;2.13.2&nbsp; 创建实例对象... 47</p>
<p style="margin-left: 30px">&nbsp;2.13.3&nbsp; 类的私有化... 48</p>
<p style="margin-left: 30px">&nbsp;2.13.4&nbsp; 类继承... 49</p>
<p style="margin-left: 30px">&nbsp;2.13.5&nbsp; 类的重写... 51</p>
<p style="margin-left: 30px">&nbsp;2.14&nbsp; 模块... 52</p>
<p style="margin-left: 30px">&nbsp;2.14.1&nbsp; 模块的分类... 52</p>
<p style="margin-left: 30px">&nbsp;2.14.2&nbsp; 模块的导入... 52</p>
<p style="margin-left: 30px">&nbsp;2.15&nbsp; 作用域... 53</p>
<p style="margin-left: 30px">&nbsp;2.16&nbsp; 异常机制... 54</p>
<p style="margin-left: 30px">&nbsp;2.16.1&nbsp; try-except 54</p>
<p style="margin-left: 30px">&nbsp;2.16.2&nbsp; else. 55</p>
<p style="margin-left: 30px">&nbsp;2.16.3&nbsp; finally. 56</p>
<p style="margin-left: 30px">&nbsp;2.17&nbsp; __init__.py文件... 56</p>
<p style="margin-left: 30px">&nbsp;2.18&nbsp; Python实用技巧... 57</p>
<p style="margin-left: 30px">&nbsp;第3章&nbsp; Selenium WebDriver 62</p>
<p style="margin-left: 30px">&nbsp;3.1&nbsp; WebDriver 简介... 62</p>
<p style="margin-left: 30px">&nbsp;3.1.1&nbsp; WebDriver的特点... 62</p>
<p style="margin-left: 30px">&nbsp;3.1.2&nbsp; 常用WebDriver 63</p>
<p style="margin-left: 30px">&nbsp;3.2&nbsp; 源码中查找元素... 63</p>
<p style="margin-left: 30px">&nbsp;3.2.1&nbsp; 查看网页源码... 63</p>
<p style="margin-left: 30px">&nbsp;3.2.2&nbsp; 查找元素的属性... 64</p>
<p style="margin-left: 30px">&nbsp;3.3&nbsp; 元素定位... 65</p>
<p style="margin-left: 30px">&nbsp;3.3.1&nbsp; id定位... 68</p>
<p style="margin-left: 30px">&nbsp;3.3.2&nbsp; class定位... 68</p>
<p style="margin-left: 30px">&nbsp;3.3.3&nbsp; name定位... 69</p>
<p style="margin-left: 30px">&nbsp;3.3.4&nbsp; tag定位... 70</p>
<p style="margin-left: 30px">&nbsp;3.3.5&nbsp; xPath定位... 70</p>
<p style="margin-left: 30px">&nbsp;3.3.6&nbsp; link定位... 71</p>
<p style="margin-left: 30px">&nbsp;3.3.7&nbsp; Partial link定位... 72</p>
<p style="margin-left: 30px">&nbsp;3.3.8&nbsp; CSS选择器定位... 72</p>
<p style="margin-left: 30px">&nbsp;3.3.9&nbsp; By定位... 73</p>
<p style="margin-left: 30px">&nbsp;3.3.10&nbsp; 确认元素的唯一性... 74</p>
<p style="margin-left: 30px">&nbsp;3.4&nbsp; 定位一组元素... 76</p>
<p style="margin-left: 30px">&nbsp;3.5&nbsp; 浏览器操作... 78</p>
<p style="margin-left: 30px">&nbsp;3.5.1&nbsp; 浏览器最大化... 78</p>
<p style="margin-left: 30px">&nbsp;3.5.2&nbsp; 设置浏览器的宽和高... 78</p>
<p style="margin-left: 30px">&nbsp;3.5.3&nbsp; 访问网页... 78</p>
<p style="margin-left: 30px">&nbsp;3.5.4&nbsp; 浏览器后退... 79</p>
<p style="margin-left: 30px">&nbsp;3.5.5&nbsp; 浏览器前进... 79</p>
<p style="margin-left: 30px">&nbsp;3.5.6&nbsp; 刷新页面... 80</p>
<p style="margin-left: 30px">&nbsp;3.5.7&nbsp; 关闭浏览器当前窗口... 80</p>
<p style="margin-left: 30px">&nbsp;3.5.8&nbsp; 结束进程... 80</p>
<p style="margin-left: 30px">&nbsp;3.5.9&nbsp; 获取页面 title. 81</p>
<p style="margin-left: 30px">&nbsp;3.5.10&nbsp; 获取当前页面的URL. 81</p>
<p style="margin-left: 30px">&nbsp;3.5.11&nbsp; 获取页面源码... 82</p>
<p style="margin-left: 30px">&nbsp;3.5.12&nbsp; 切换浏览器窗口... 83</p>
<p style="margin-left: 30px">&nbsp;3.5.13&nbsp; 滚动条操作... 86</p>
<p style="margin-left: 30px">&nbsp;3.6&nbsp; 对象操作... 88</p>
<p style="margin-left: 30px">&nbsp;3.6.1&nbsp; 单击对象... 89</p>
<p style="margin-left: 30px">&nbsp;3.6.2&nbsp; 输入内容... 89</p>
<p style="margin-left: 30px">&nbsp;3.6.3&nbsp; 清空内容... 90</p>
<p style="margin-left: 30px">&nbsp;3.6.4&nbsp; 提交表单... 90</p>
<p style="margin-left: 30px">&nbsp;3.6.5&nbsp; 获取文本内容... 90</p>
<p style="margin-left: 30px">&nbsp;3.6.6&nbsp; 获取对象属性值... 91</p>
<p style="margin-left: 30px">&nbsp;3.6.7&nbsp; 对象显示状态... 91</p>
<p style="margin-left: 30px">&nbsp;3.6.8&nbsp; 对象编辑状态... 94</p>
<p style="margin-left: 30px">&nbsp;3.6.9&nbsp; 对象选择状态... 95</p>
<p style="margin-left: 30px">&nbsp;3.7&nbsp; 键盘操作... 96</p>
<p style="margin-left: 30px">&nbsp;3.7.1&nbsp; send_keys 操作... 96</p>
<p style="margin-left: 30px">&nbsp;3.7.2&nbsp; keyUp/keyDown 操作... 98</p>
<p style="margin-left: 30px">&nbsp;3.8&nbsp; 鼠标操作... 99</p>
<p style="margin-left: 30px">&nbsp;3.8.1&nbsp; 鼠标右击... 99</p>
<p style="margin-left: 30px">&nbsp;3.8.2&nbsp; 鼠标双击... 99</p>
<p style="margin-left: 30px">&nbsp;3.8.3&nbsp; 鼠标悬停... 100</p>
<p style="margin-left: 30px">&nbsp;3.8.4&nbsp; 鼠标拖放... 100</p>
<p style="margin-left: 30px">&nbsp;3.8.5&nbsp; 鼠标其他事件... 101</p>
<p style="margin-left: 30px">&nbsp;3.9&nbsp; 下拉框操作... 101</p>
<p style="margin-left: 30px">&nbsp;3.10&nbsp; 特殊Dom结构操作... 103</p>
<p style="margin-left: 30px">&nbsp;3.10.1&nbsp; Windows弹窗... 103</p>
<p style="margin-left: 30px">&nbsp;3.10.2&nbsp; 非Windows弹窗... 106</p>
<p style="margin-left: 30px">&nbsp;3.10.3&nbsp; frame与iframe. 108</p>
<p style="margin-left: 30px">&nbsp;3.11&nbsp; 文件上传操作... 110</p>
<p style="margin-left: 30px">&nbsp;3.11.1&nbsp; 直接上传... 110</p>
<p style="margin-left: 30px">&nbsp;3.11.2&nbsp; 使用AutoIt上传... 112</p>
<p style="margin-left: 30px">&nbsp;3.11.3&nbsp; 使用WinSpy上传... 115</p>
<p style="margin-left: 30px">&nbsp;3.12&nbsp; 文件下载操作... 119</p>
<p style="margin-left: 30px">&nbsp;3.12.1&nbsp; 手动修改... 119</p>
<p style="margin-left: 30px">&nbsp;3.12.2&nbsp; 通过options修改... 119</p>
<p style="margin-left: 30px">&nbsp;3.13&nbsp; WebDriver的高级特性... 120</p>
<p style="margin-left: 30px">&nbsp;3.13.1&nbsp; cookie操作... 120</p>
<p style="margin-left: 30px">&nbsp;3.13.2&nbsp; JavaScript调用... 122</p>
<p style="margin-left: 30px">&nbsp;3.13.3&nbsp; 屏幕截图... 122</p>
<p style="margin-left: 30px">&nbsp;3.14&nbsp; 时间等待... 123</p>
<p style="margin-left: 30px">&nbsp;3.14.1&nbsp; 强制等待... 123</p>
<p style="margin-left: 30px">&nbsp;3.14.2&nbsp; 隐式等待... 124</p>
<p style="margin-left: 30px">&nbsp;3.14.3&nbsp; 显式等待... 124</p>
<p style="margin-left: 30px">&nbsp;3.15&nbsp; 其他设置... 125</p>
<p style="margin-left: 30px">&nbsp;3.15.1&nbsp; 限制页面加载时间... 125</p>
<p style="margin-left: 30px">&nbsp;3.15.2&nbsp; 获取环境信息... 126</p>
<p style="margin-left: 30px">&nbsp;3.15.3&nbsp; 非W3C标准命令... 127</p>
<p style="margin-left: 30px">&nbsp;3.16&nbsp; 配置Chrome浏览器... 127</p>
<p style="margin-left: 30px">&nbsp;3.17&nbsp; SSL证书错误处理... 129</p>
<p style="margin-left: 30px">&nbsp;第4章&nbsp; UnitTest测试框架... 131</p>
<p style="margin-left: 30px">&nbsp;4.1&nbsp; UnitTest简介... 131</p>
<p style="margin-left: 30px">&nbsp;4.2&nbsp; TestFixture. 132</p>
<p style="margin-left: 30px">&nbsp;4.3&nbsp; TestCase. 133</p>
<p style="margin-left: 30px">&nbsp;4.4&nbsp; 断言Assert 135</p>
<p style="margin-left: 30px">&nbsp;4.5&nbsp; TestSuit 137</p>
<p style="margin-left: 30px">&nbsp;4.5.1&nbsp; TestSuite直接构建测试集... 137</p>
<p style="margin-left: 30px">&nbsp;4.5.2&nbsp; addTest( )构建测试集... 138</p>
<p style="margin-left: 30px">&nbsp;4.5.3&nbsp; addTests( )构建测试集... 139</p>
<p style="margin-left: 30px">&nbsp;4.5.4&nbsp; skip装饰器... 139</p>
<p style="margin-left: 30px">&nbsp;4.6&nbsp; TestLoader 140</p>
<p style="margin-left: 30px">&nbsp;4.7&nbsp; TestRunner 142</p>
<p style="margin-left: 30px">&nbsp;4.8&nbsp; 生成HTML报告... 143</p>
<p style="margin-left: 30px">&nbsp;第5章&nbsp; Selenium Grid. 145</p>
<p style="margin-left: 30px">&nbsp;5.1&nbsp; Selenium Grid简介... 145</p>
<p style="margin-left: 30px">&nbsp;5.2&nbsp; Selenium Grid的工作原理... 145</p>
<p style="margin-left: 30px">&nbsp;5.3&nbsp; Selenium Grid测试环境的搭建... 146</p>
<p style="margin-left: 30px">5.3.1&nbsp; 文件准备... 146</p>
<p style="margin-left: 30px">5.3.2&nbsp; 部署Hub节点... 147</p>
<p style="margin-left: 30px">5.3.3&nbsp; 部署Node节点... 148&nbsp;</p>
<p style="margin-left: 30px">5.4&nbsp; 测试脚本开发... 149</p>
<p style="margin-left: 30px">5.4.1&nbsp; 指定Node节点... 149</p>
<p style="margin-left: 30px">5.4.2&nbsp; 指定Hub地址... 150</p>
<p style="margin-left: 30px">第6章&nbsp; Pytest测试框架... 152</p>
<p style="margin-left: 30px">6.1&nbsp; Pytest简介... 152</p>
<p style="margin-left: 30px">6.2&nbsp; Console参数... 154</p>
<p style="margin-left: 30px">6.2.1&nbsp; 实例初体验... 154</p>
<p style="margin-left: 30px">6.2.2&nbsp; -v参数... 155</p>
<p style="margin-left: 30px">6.2.3&nbsp; -h参数... 156</p>
<p style="margin-left: 30px">6.2.4&nbsp; 其他参数... 156</p>
<p style="margin-left: 30px">6.3&nbsp; mark标记... 157</p>
<p style="margin-left: 30px">6.3.1&nbsp; 标记测试函数... 157</p>
<p style="margin-left: 30px">6.3.2&nbsp; 示例说明... 158</p>
<p style="margin-left: 30px">6.3.3&nbsp; 直接标记... 163</p>
<p style="margin-left: 30px">6.3.4&nbsp; 模糊匹配标记... 165</p>
<p style="margin-left: 30px">6.3.5&nbsp; 使用mark自定义标记... 166</p>
<p style="margin-left: 30px">6.4&nbsp; 固件 Fixture. 167&nbsp;</p>
<p style="margin-left: 30px">6.4.1&nbsp; Fixture的使用... 167</p>
<p style="margin-left: 30px">6.4.2&nbsp; Fixure的作用域... 168</p>
<p style="margin-left: 30px">6.4.3&nbsp; autouse(自动使用)... 170&nbsp;</p>
<p style="margin-left: 30px">6.4.4&nbsp; yield的使用... 171</p>
<p style="margin-left: 30px">6.4.5&nbsp; 共享Fixture功能... 173</p>
<p style="margin-left: 30px">6.4.6&nbsp; 参数化... 175</p>
<p style="margin-left: 30px">6.4.7&nbsp; 内置Fixture. 176</p>
<p style="margin-left: 30px">6.5&nbsp; Pytest插件... 182</p>
<p style="margin-left: 30px">6.5.1&nbsp; 插件的安装与卸载... 182</p>
<p style="margin-left: 30px">6.5.2&nbsp; 查看活动插件... 183</p>
<p style="margin-left: 30px">6.5.3&nbsp; 插件的注销... 184</p>
<p style="margin-left: 30px">6.6&nbsp; Allure测试报告... 184</p>
<p style="margin-left: 30px">6.6.1&nbsp; Allure的安装... 184&nbsp;</p>
<p style="margin-left: 30px">6.6.2&nbsp; 脚本应用... 186</p>
<p style="margin-left: 30px">6.6.3&nbsp; 报告生成... 186</p>
<p style="margin-left: 30px">第7章&nbsp; Python脚本开发常用模块... 189</p>
<p style="margin-left: 30px">7.1&nbsp; 日期和时间模块time和datetime. 189</p>
<p style="margin-left: 30px">7.2&nbsp; 文件和目录模块os 190</p>
<p style="margin-left: 30px">7.3&nbsp; 系统功能模块sys 191</p>
<p style="margin-left: 30px">7.4&nbsp; 导入第三方模块pip. 192&nbsp;</p>
<p style="margin-left: 30px">7.5&nbsp; 邮件模块smtplib. 195</p>
<p style="margin-left: 30px">7.5.1&nbsp; 开启邮箱SMTP服务... 195</p>
<p style="margin-left: 30px">7.5.2&nbsp; smtplib模块的使用... 196</p>
<p style="margin-left: 30px">7.6&nbsp; 日志模块logging. 199&nbsp;</p>
<p style="margin-left: 30px">7.7&nbsp; CSV文件读写模块csv. 201</p>
<p style="margin-left: 30px">7.8&nbsp; Excel操作模块openpyxl 203</p>
<p style="margin-left: 30px">7.9&nbsp; MySQL数据库操作包pymysql 205</p>
<p style="margin-left: 30px">7.9.1&nbsp; 简单使用... 206</p>
<p style="margin-left: 30px">7.9.2&nbsp; 获取查询数据... 207</p>
<p style="margin-left: 30px">7.9.3&nbsp; 增删改数据... 209</p>
<p style="margin-left: 30px">7.10&nbsp; JSON数据... 210</p>
<p style="margin-left: 30px">7.10.1&nbsp; JSON语法... 210&nbsp;</p>
<p style="margin-left: 30px">7.10.2&nbsp; Python读写JSON.. 211</p>
<p style="margin-left: 30px">7.11&nbsp; 多线程模块threading. 212</p>
<p>&nbsp;第二篇&nbsp; 实践篇&nbsp;</p>
<p style="margin-left: 30px">第8章&nbsp; 数据驱动模型及项目应用... 215</p>
<p style="margin-left: 30px">8.1&nbsp; 数据驱动简介... 215</p>
<p style="margin-left: 30px">8.2&nbsp; ddt的使用... 216&nbsp;</p>
<p style="margin-left: 30px">8.2.1&nbsp; ddt的安装... 216</p>
<p style="margin-left: 30px">8.2.2&nbsp; ddt的常用方法... 216</p>
<p style="margin-left: 30px">8.2.3&nbsp; 实例... 217</p>
<p style="margin-left: 30px">8.3&nbsp; 项目解析... 218</p>
<p style="margin-left: 30px">8.4&nbsp; 框架搭建... 220&nbsp;</p>
<p style="margin-left: 30px">8.5&nbsp; 设计测试用例... 221</p>
<p style="margin-left: 30px">8.6&nbsp; 数据文件操作... 222</p>
<p style="margin-left: 30px">8.7&nbsp; 测试用例生成... 225</p>
<p style="margin-left: 30px">8.7.1&nbsp; Excel数据处理... 225</p>
<p style="margin-left: 30px">8.7.2&nbsp; 测试步骤... 226</p>
<p style="margin-left: 30px">8.7.3&nbsp; 断言处理... 227</p>
<p style="margin-left: 30px">8.7.4&nbsp; 使用ddt生成测试用例... 228</p>
<p style="margin-left: 30px">8.8&nbsp; 测试执行... 229</p>
<p style="margin-left: 30px">第9章&nbsp; PO模型——一个测试项目的实现... 231</p>
<p style="margin-left: 30px">9.1&nbsp; 项目解析... 231</p>
<p style="margin-left: 30px">9.1.1&nbsp; 主页... 232&nbsp;</p>
<p style="margin-left: 30px">9.1.2&nbsp; 关于我们页面... 233</p>
<p style="margin-left: 30px">9.1.3&nbsp; 退出登录... 233</p>
<p style="margin-left: 30px">9.2&nbsp; 框架搭建... 233</p>
<p style="margin-left: 30px">9.3&nbsp; 配置文件... 235</p>
<p style="margin-left: 30px">9.4&nbsp; 常用结构的封装... 236</p>
<p style="margin-left: 30px">9.4.1&nbsp; 判断元素存在... 236&nbsp;</p>
<p style="margin-left: 30px">9.4.2&nbsp; Tab切换... 236</p>
<p style="margin-left: 30px">9.4.3&nbsp; 多级菜单... 239</p>
<p style="margin-left: 30px">9.4.4&nbsp; 表格结构... 241</p>
<p style="margin-left: 30px">9.4.5&nbsp; 分页... 244</p>
<p style="margin-left: 30px">9.5&nbsp; 页面封装... 246</p>
<p style="margin-left: 30px">9.5.1&nbsp; 基础页面... 246</p>
<p style="margin-left: 30px">9.5.2&nbsp; 登录页面... 248</p>
<p style="margin-left: 30px">9.5.3&nbsp; 主页页面... 251&nbsp;</p>
<p style="margin-left: 30px">9.5.4&nbsp; 关于我们页面... 257</p>
<p style="margin-left: 30px">9.5.5&nbsp; 退出登录功能... 257</p>
<p style="margin-left: 30px">9.6&nbsp; 测试用例生成... 257</p>
<p style="margin-left: 30px">9.6.1&nbsp; 登录功能的测试用例... 257</p>
<p style="margin-left: 30px">9.6.2&nbsp; 主页页面测试用例... 258&nbsp;</p>
<p style="margin-left: 30px">9.6.3&nbsp; 关于我们页面的测试用例... 260</p>
<p style="margin-left: 30px">9.6.4&nbsp; 退出登录功能的测试用例... 260</p>
<p style="margin-left: 30px">9.7&nbsp; 测试用例的组织... 261</p>
<p style="margin-left: 30px">9.8&nbsp; 设置项目入口... 262</p>
<p style="margin-left: 30px">第10章&nbsp; 持续集成在自动化测试中的应用... 264</p>
<p style="margin-left: 30px">10.1&nbsp; Jenkins的安装... 264</p>
<p style="margin-left: 30px">10.1.1&nbsp; Jenkins的下载... 264</p>
<p style="margin-left: 30px">10.1.2&nbsp; 安装... 265</p>
<p style="margin-left: 30px">10.1.3&nbsp; 创建管理员用户... 267</p>
<p style="margin-left: 30px">10.2&nbsp; 创建项目... 267</p>
<p style="margin-left: 30px">10.3&nbsp; 任务定时... 269&nbsp;</p>
<p style="margin-left: 30px">10.3.1&nbsp; 任务定时构建的设置... 269</p>
<p style="margin-left: 30px">10.3.2&nbsp; 设置说明... 270</p>
<p style="margin-left: 30px">10.3.3&nbsp; 构建实例... 271</p>
<p style="margin-left: 30px">10.4&nbsp; 邮件发送... 271</p>
<p style="margin-left: 30px">10.4.1&nbsp; 插件安装... 271</p>
<p style="margin-left: 30px">10.4.2&nbsp; HTML&nbsp;报告配置... 273</p>
<p style="margin-left: 30px">10.4.3&nbsp; 邮件配置... 275</p>
<p style="margin-left: 30px">&nbsp;</p>
<p>第三篇&nbsp; 卓异篇</p>
<p style="margin-left: 30px">第11章&nbsp; 自动化测试模型... 279&nbsp;</p>
<p style="margin-left: 30px">11.1&nbsp; 自动化测试模型简介... 279</p>
<p style="margin-left: 30px">11.2&nbsp; 线性模型... 281</p>
<p style="margin-left: 30px">11.3&nbsp; 模块化驱动模型... 282</p>
<p style="margin-left: 30px">11.4&nbsp; 数据驱动模型... 282&nbsp;</p>
<p style="margin-left: 30px">11.5&nbsp; 关键字驱动模型... 282</p>
<p style="margin-left: 30px">11.6&nbsp; 混合驱动模型... 283</p>
<p style="margin-left: 30px">11.7&nbsp; 行为驱动模型... 283</p>
<p style="margin-left: 30px">11.7.1&nbsp; 安装Behave. 284</p>
<p style="margin-left: 30px">11.7.2&nbsp; Behave的使用... 286</p>
<p style="margin-left: 30px">11.7.3&nbsp; 运行... 288&nbsp;</p>
<p style="margin-left: 30px">11.7.4&nbsp; 生成测试报告... 289</p>
<p style="margin-left: 30px">第12章&nbsp; 高质量代码的编写... 291</p>
<p style="margin-left: 30px">12.1&nbsp; 编码规范... 291</p>
<p style="margin-left: 30px">12.2&nbsp; 分层与结构... 294</p>
<p style="margin-left: 30px">12.3&nbsp; 阅读源码的技巧... 295</p>
<p style="margin-left: 30px">12.3.1&nbsp; 分析层次... 295</p>
<p style="margin-left: 30px">12.3.2&nbsp; 分析结构... 296</p>
<p style="margin-left: 30px">12.3.3&nbsp; 分析具体文件... 296</p>
<p style="margin-left: 30px">12.4&nbsp; 持续学习... 298</p>
<p style="margin-left: 30px">第13章&nbsp; 用Git管理项目... 299</p>
<p style="margin-left: 30px">13.1&nbsp; Git简介... 299</p>
<p style="margin-left: 30px">13.2&nbsp; 安装Git 300</p>
<p style="margin-left: 30px">13.3&nbsp; Git的配置... 301</p>
<p style="margin-left: 30px">13.3.1&nbsp; 配置用户信息... 301</p>
<p style="margin-left: 30px">13.3.2&nbsp; 文本编辑器配置... 301</p>
<p style="margin-left: 30px">13.3.3&nbsp; 配置差异分析工具... 301</p>
<p style="margin-left: 30px">13.3.4&nbsp; 查看配置信息... 302</p>
<p style="margin-left: 30px">13.4&nbsp; 常用命令... 302</p>
<p style="margin-left: 30px">13.5&nbsp; GitHub. 304</p>
<p style="margin-left: 30px">13.5.1&nbsp; 账号注册... 304</p>
<p style="margin-left: 30px">13.5.2&nbsp; 创建仓库... 306</p>
<p style="margin-left: 30px">13.5.3&nbsp; 上传项目... 307</p>
<p style="margin-left: 30px">13.5.4&nbsp; Jenkins与Git 308</p>
<p style="margin-left: 30px">第14章&nbsp; 精选面试题... 310</p>
<p style="margin-left: 30px">14.1&nbsp; Python题... 310</p>
<p style="margin-left: 30px">14.2&nbsp; Selenium题... 317&nbsp;</p>
<p style="margin-left: 30px">14.3&nbsp; 开放性题... 321</p>
<p style="margin-left: 30px">附录1&nbsp; 示例代码... 324</p>
<p style="margin-left: 30px">附录2&nbsp; 项目搭建... 327&nbsp;</p>
<p style="margin-left: 30px">参考文献... 330</p>
<p style="margin-left: 30px">&nbsp;</p><br><br>
来源:https://www.cnblogs.com/tynam/p/12886494.html
頁: [1]
查看完整版本: Python Web自动化测试入门与实战,从入门到入行