《软件自动化测试成功之道》读书笔记.pdf_第1页
《软件自动化测试成功之道》读书笔记.pdf_第2页
《软件自动化测试成功之道》读书笔记.pdf_第3页
《软件自动化测试成功之道》读书笔记.pdf_第4页
《软件自动化测试成功之道》读书笔记.pdf_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

TIB 自动化测试工作室 软件自动化测试成功之道 读书笔记 软件自动化测试成功之道 读书笔记 1 软件自动化测试成功之道 学习路线 软件自动化测试成功之道 学习路线 1 学习光盘附带的 TestComplete 和 QTP 的视频 2 学习 TestComplete 和 QTP 软件自动化测试成功之道 QTP 自动化测试进阶 3 使用 TestComplete QTP 等自动化测试工具进行自动化测试实践 参考 TestComplete AutomatedQA 公司的自动化测试工具 主要特点 支持 VB Script JScript Delphi Script C Script C Script 作为脚本语言 一个工具就能 支持功能自动化测试 WEB 负载测试 分布式测试 单元测试等 价格便宜 999 目前最新版本 7 52 下载地址 选择自动化测试工具需要考虑的选择自动化测试工具需要考虑的 19 个方面个方面 在为自动化测试项目做工具选型时 需要考虑以下几个方面的因素来决定选择哪个自动化测 试工具 1 对不同类型的应用程序和平台的支持 2 对不同类型的操作系统的支持 3 对不同的测试类型的支持 4 脚本语言 编辑器和调试器 5 录制测试脚本的能力 6 应对变化的能力 7 对控件和对象的支持 8 支持不同渠道的测试数据 9 运行测试与测试对象的同步 10 检查点 11 测试结果记录和导出报告 12 扩展性 13 测试多语言应用程序的能力 14 对团队协作和源代码管理的支持 15 对命令行和 OLE 自动化的支持 16 与团队协作系统以及软件构建系统的整合 17 技术支持 18 价格 19 试用版 软件自动化测试成功之道 读书笔记 软件自动化测试成功之道 读书笔记 2 学习 软件自动化测试成功之道 附带光盘中的 TestComplete 基础教程基础教程 1 TC 简介 swf 2 安装 swf 3 White Box Application swf 4 项目创建 1 swf 5 项目创建 2 avi swf 6 运行 AUT swf 7 Code Complete swf 8 录制脚本 swf 参考 TestComplete 6 中录制回放功能的使用介绍 视频 TC8 0 不仅修改了录制工具栏的设计 易用性更强了 可在录制时修改脚本名 而且在 Opetions Engines Recording 中提供了 Record user actions over tested applications only 选项 可以让你仅仅录制选定的被测试程序 另外 录制时会自动存储映射对象的方法和属性 这样录制完成后 即使关闭了被测试对象 也能访问对象的方法和属性 学习 软件自动化测试成功之道 第第 2 章章 自动化测试工具自动化测试工具 Windows 的 API 中封装了很多可用于自动化测试编程的函数 例如 FindWindow GetWindowRect 等函数 这些函数可在编程语言或脚本代码中进行调用 从而实现自动化测 试编程 安装 IE Developer ToolBar 学习 DOM 相关知识 1 常用 DOM 属性 className 同一样式规则的元素用相同的类名 可通过 className 快速过滤出一组 类似的元素 document 用于指向包含当前元素的文档对象 id 当前元素的标识 如果文档中包含多个相同 id 的元素 则返回一个数组 innerHTML 用于指向当前元素的开始标记和结束标记之间的所有文本和 HTML 标 签 innerText 用于指向当前元素的开始标记和结束标记之间的所有文本和HTML标签 offsetHeight offsetWidth 元素的高度和宽度 offsetLeft offsetTop 当前元素相同对于父亲元素的左边位置和顶部位置 outerHTML 当前元素的开始标记和结束标记之间的所有文本和 HTML 标签 outerText 当前元素的开始标记和结束标记之间的所有文本 但不包括 HTML 标签 parentElement 当前元素的父亲元素 sourceIndex 元素在 document all 集合中的索引 index style 元素的样式表单属性 tagName 当前元素的标签名 title 在 IE 中 代表元素的 tool tip 文本 2 常用 DOM 方法 click 模拟用户对当前元素的鼠标点击 contains element 用于判断当前元素是否包含指定的元素 getAttribute attributeName caseSensitive 返回当前元素所包含的某个属性 参数 attributeName 为属性名 caseSensitive 表示是否大小写敏感 setAttribute attributeName value caseSenstive 设置当前元素的属性 3 常用 DOM 集合 All 当前元素中包含的所有 HTML 元素的数组 children 当前元素包含的孩子元素 使用使用 HTML DOM 进行自动化测试的简单例子进行自动化测试的简单例子 把下面 VBScript 脚本另存为 GoogleTest vbs 双击运行 Dim oIee objedit Dim oPagtxt Set oIee CreateObject InternetExplorer Application oIee navigate hk oIee Visible True Do While oIee readystate 4 Loop Set oPagtxt oIee document set objedit oPagtxt getelementsbyname q objedit 0 value QTP 自动化测试进阶 set objbutton oPagtxt getelementsbyname btnG objbutton 0 Click Set oIee Nothing 对于 TC 而言 C C Delphi 等程序 被称为 Black Box 应用程序 而像 NET JAVA 等 基于中间代码构建的应用程序 被称为 White Box 应用程序 参考 软件自动化测试成功之道 读书笔记 软件自动化测试成功之道 读书笔记 3 学习 软件自动化测试成功之道 附带光盘中的 TestComplete 基础教程基础教程 9 Object Browser 1 swf 10 Object Browser 2 avi swf 11 Object Browser 3 avi swf TC 的对象浏览器提供了强大的查看界面对象属性 方法的功能 在自动化测试脚本编写过 程中需要经常使用的工具 参考 官方主页上关于 TC Object Browser 的介绍 TestComplete 6 中对象浏览器 Object Browser 的使用介绍 视频 Using The Object Browser 转载 TestComplete 对象浏览器 对象浏览器 Object Browser 和进程相互影响以及解决办法 和进程相互影响以及解决办法 前两天 刚刚学习使用 TestComplete 以下简称 TC 录制脚本 在录制过程中 发现 TC 的对象浏览器 Object Browser 以下简称 OB 和被测程序本身或者其调用和产生的进程存 在着相互的影响 因为 OB 本身的功能就是显示当前系统的所有进程 而当被测程序在运行 过程中生成了某个实例 比如 Word Excel 等等 那么由于 OB 的存在 此时被测程序是 无法通过释放实例来将其进程销毁的 此时 OB 的现象是无法刷新 因此 只能使用强制结 束进程的方法将进程过掉后 脚本才能正常回放成功 软件自动化测试成功之道 读书笔记 软件自动化测试成功之道 读书笔记 4 学习 软件自动化测试成功之道 附带光盘中的 TestComplete 基础教程基础教程 12 Test Log 1 swf 13 Test Log 2 swf 14 Test Log 3 swf 测试日志记录是自动化测试不可获取的一部分 详细的日志记录有助于脚本的调试和软件的 问题分析 TestComplete 附带的附带的 Sample 中有专门一个例子中有专门一个例子 Test Log 讲解如何写入各种测试日志讲解如何写入各种测试日志 Illustrates posting a variety of pictures and messages to the test log and organizing them as a hierarchy of folders in the test log Scripts Test Log TC 的 Log 可以写 6 种类型的信息 Message Can come from TestComplete or from the script code Log Message will not cause the test to fail Warning Can come from TestComplete or from the script code Log Warning not necessary a failure for the test but could be an indicator for why a test failed Error Can come from TestComplete or from the script code Log Error this indicates a failure for the test Events Usually comes from TestComplete but can come from the script as well Log Event does not cause the test to fail TestComplete generates an event for every mouse click or keyboard entry in the test Image Usually comes from script code Log Picture but TestComplete can generate as well Region Checkpoints File There are two types of File log items Log File will copy the file into the directory holding the log XML file and creates a hyperlink to the file Log Link just creates a hyperlink to the file without copying the file 软件自动化测试成功之道 读书笔记 软件自动化测试成功之道 读书笔记 5 学习 软件自动化测试成功之道 附带光盘中的 TestComplete 基础教程基础教程 15 调试脚本 swf 调试是脚本开发的基本功 step into 表示调试时碰到函数将进入函数体内 step over 表示调试时一步一行跳过 run to cursor 表示运行到光标所在行后停住 用 VBScript 的 MsgBox 显示信息 或者把变量 对象属性 数据等写入 Log 也是一种很好 的调试方法 参考视频 在 TC 中调试脚本 Debugging Automated Test Scripts With TestComplete Describes the automated test script debugging features provided by TestComplete TestComplete 代码基本调试技巧 TestComplete Basic Debugging 软件自动化测试成功之道 读书笔记 软件自动化测试成功之道 读书笔记 6 学习 软件自动化测试成功之道 附带光盘中的 TestComplete 基础教程基础教程 16 比较文件 1 swf 17 比较文件 2 swf 18 比较对象属性 swf 检查点是自动化测试必不可少的部分 就像测试用例如果缺少了最后的测试结果检查就不是 完整的测试用例一样 自动化测试脚本中也需要添加检查步骤 一般通过检查控件对象的属 性 文件 数据库数据等来判断测试是否通过 TestComplete 支持 Region File Object 等类型的检查点 Region CheckPoint 的例子 Sub RegionCompareExample If Not Regions Compare Logo Sys Process iexplore Page 0 Link 0 Image nav r1 c1 False False True 0 Then Call Log Error The regions are not identical End If End Sub File CheckPoint 的例子 Sub FileCompareExample If Not Files Compare Sample1 txt Sample2 txt 0 True Then Call Log Error The files are not identical End If End Sub Object CheckPoint 的例子 Sub ObjectCompareExample If Not Objects Compare Sys Process iexplore Page Panel True Then Call Log Error The objects are not identical End If End Sub 参考 TestComplete 附带的 Sample 例子进行练习 Checkpoints Samples 检查点的使用 检查点的使用 TestComplete includes a number of samples that demonstrate how to perform various kinds of checkpoints Database Table Checkpoints 数据表检查点 数据表检查点 Scripts CheckpointsSamples DatabaseTableCheckpoints File Checkpoints 文件检查点 文件检查点 Scripts CheckpointsSamples FileCheckpoints Object Checkpoints 对象检查点 对象检查点 Scripts CheckpointsSamples ObjectCheckpoints Property Checkpoints 属性检查点 属性检查点 Scripts CheckpointsSamples PropertyCheckpoints Region Checkpoints 区域检查点 区域检查点 Scripts CheckpointsSamples RegionCheckpoints Table Checkpoints 表格检查点 表格检查点 Scripts CheckpointsSamples TableCheckpoints WebAccessibility Checkpoints Web 可访问性检查点 可访问性检查点 Scripts CheckpointsSamples WebAccessibilityCheckpoints WebComparison Checkpoints Web 对比检查点 对比检查点 Scripts CheckpointsSamples WebComparisonCheckpoints Web Service Checkpoints Web Service 检查点 检查点 Scripts CheckpointsSamples WebServiceCheckpoints XML Checkpoints XML 检查点 检查点 Scripts CheckpointsSamples XMLCheckpoints TestComplete 6 中对象检查点的使用介绍 视频 Object Checkpoints 在 TestComplete 的关键字视图中如何使用 Stores 和 Checkpoints 进行对象属性 表格数据 文件的检查 视频 Using Stores Checkpoints in a TestComplete Keyword Test In this video we look using Stores Checkpoints a powerful feature of TestComplete providing the ability to capture test data during test recording We examine TestComplete v7 s new Checkpoint Wizard feature and incorporate the following Checkpoints within the test Object multiple object property comparison Table verifying tabular data File comparing data created during the test tComplete Keyword Test aspx 如何在 TestComplete 中整合 Beyond Compare 进行文件比较 视频 TestComplete file compare with Beyond Compare Compare aspx 软件自动化测试成功之道 读书笔记 软件自动化测试成功之道 读书笔记 7 学习 软件自动化测试成功之道 附带光盘中的 TestComplete 基础教程基础教程 19 数据驱动 1 swf 20 数据驱动 2 swf TC 用 DDT 来支持数据驱动测试 DDT 包括 3 种类型 1 CVSDriver is used to read text file such as comma delimited default or tab delimited using a schema ini file By default the first row is the header information or column names for the driver 2 ExcelDriver is used to read an Excel spreadsheet The first row of the sheet is the header information for the driver 3 ADODriver is a generic driver to read in ADO compatible data source 阅读 软件自动化测试成功之道 的第 6 章 自动化测试框架的搭建 数据驱动框架与关键字驱动框架类似 测试数据都存储在数据库或 Excel 文件 但是数据驱 动框架的测试用例 测试步骤和测试逻辑是在测试脚本中编写的 而不像关键字驱动框架一 样放在表格中 脚本从表格中读入测试数据 包括测试输入的数据 测试结果验证的数据 通过循环遍历数 据表格中的所有行 可以极大地增大测试覆盖面 测试各种输入条件下应用程序的表现 学习 TestComplete 附带的 Sample DDT 数据驱动测试 数据驱动测试 This sample is used by the Data Driven Testing Tutorial that describes a step by step procedure of creating data driven tests in TestComplete The script tests the OrdersDemo application which is used to configure a table of purchase orders The script reads data from an Excel sheet and adds new records to the table Excel file and TestComplete project suite Scripts DDT DDT NameMapping 数据驱动测试 使用 数据驱动测试 使用 NameMapping Illustrates how to perform data driven tests in TestComplete See also Data Driven Testing The script tests the OrdersDemo application which is used to configure a table of purchase orders The script adds new records to the table and modifies existing ones The data the script enters to table records are taken from different sources a multidimensional array defined directly in the script a comma separated values CSV file that the script accesses via Scripting FileSystemObject a CSV file that the script accesses via ADO a Microsoft Access database that the script accesses via ADO and an Excel file that the script accesses via ADO In order to unify the testing of the language specific implementations of the OrdersDemo application there are versions written in Microsoft Visual C Microsoft Visual Basic Borland Delphi and Borland C Builder the script uses custom object names See Name Mapping Data Scripts DDT NameMapping Data TestComplete project suite Scripts DDT NameMapping TestComplete 数据驱动测试的视频 如何在 TestComplete 的关键字视图中使用 DDT 实现数据驱动 视频 Data Driven Testing in Keyword Testing aspx 如何在 TestComplete 中使用 CSV 文件进行数据驱动测试 视频 Data Driven Testing With CSV files 如何在 TestComplete 中使用数据库表进行数据驱动测试 视频 Data Driven Testing With database Tables es aspx 软件自动化测试成功之道 读书笔记 软件自动化测试成功之道 读书笔记 8 学习 软件自动化测试成功之道 附带光盘中的 TestComplete 基础教程基础教程 21 事件处理 1 swf 22 事件处理 2 swf TC 的事件处理机制类似于 QTP 的场景恢复机制 一般用于处理非预期异常事件 非预期弹 出窗口 TC 中可处理的一般事件包括 中可处理的一般事件包括 OnLogCloseNode Occurs when a log folder is pop off the log OnLogCreateNode Occurs when a new log folder is appended on the log OnLogError Occurs when an error message is posted to the log OnLogEvent Occurs when an event message is posted to the log OnLogFile Occurs when a file is posted to the log OnLogLink Occurs when a file reference link is posted to the log OnLogMessage Occurs when a information message is posted to the log OnLogPicture Occurs when a picture image is posted to the log OnLogWarning Occurs when a warning message is posted to the log OnOverlappingWindow Occurs when a overlapping window appears OnTimeout Occurs when a timeout expires in a project or project suite OnUnexpectedWindow Occurs when an unexpected window ap

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论