新学UFT刚装上新硬盘不显示UFT12.02,用内部的flight玩了一下,就出现这样的提示,然后就over了,求大神指教!急!急

当前位置: >>
讲师 李含欢 QTP 概述? 为什么要做自动化? ? QTP主窗口 ? QTP Test的两种视图 为甚么要做自动 化?版本更新得回归了!啊!!又来!谁能来帮我回归测试! 优点?在回归测试中应用广泛代替重复劳动,其脚本可用 于回归测试 ?无人值守,实时监控 ?补充手工用例不足 ?持续集成
缺点?1. 编写脚本耗时较长 ?2. 风险大,如果没有良好的成本分析与自动化测试过程控制手 段,自动化测试很有可能失败,浪费人力与物力 ?3. 由于机器执行不如人工智能, 发现bug较少,单纯依靠自动 化测试无法保证产品质量,永远无法替代手工测试 ?QTP 主窗口 ?QTP Test的两种视图? Keyword View:关键字视图 通过可视化方法增强脚本功能 ? Expert View:专家视图 使用VBScript脚本语言增强脚本功能注意:无论是关键字视图还是专家视图,都是记录操作步骤的脚本,只是 记录的方式不同而已,任何一方的改动,都会在另一方中马上体现出来 关键字视图中各字段含义知 识 讲 解? ? ? ?Item:以分层的形式显示所有操作到的控件 Operation:在控件上执行的动作 Value:执行动作时用户输入的数据,或者参数化的参数值 Documentation:用于描述操作步骤的文字说明,一般由系统自动产生 Flight系统自动化测试案例?Flight 系统的业务介绍 ? Flight系统的测试需求 ? Flight系统的测试计划 ? 使用QTP实现自动化测试 ? Flight系统的业务介绍? ? ? ?登录Flight系统 在Flight系统中创建订单 在Flight系统中打开订单 在Flight系统中修改订单 ? Flight系统的测试需求?被测业务流程:登录---创建订单---关闭 系统 测试功能:创建订单的功能是否正确 测试工具:UFT12.0自动化测试工具? ? ?Flight系统的测试计划登录 用户名:amber 密码:mercury 订票 预订一张伦敦-&法兰克福的票 ?日期:、 ?起点:London ?终点:Frankfurt ?航班:默认航班 ?姓名:Jason ?票数:1 ?等级:Economy 脚本保存名称:NewOrder ? 使用QTP实现自动化测试录制脚本 ? 使用QTP实现自动化测试回放脚本 ? 使用QTP实现自动化测试分析结果 知 识 案 例查看运行手工启动录制的代码systemUtil.Run &C:\Program Files\HP\Unified Functional Testing\samples\flight\app\flight4a.exe&‘登录系统 ‘启动代码Dialog(&Login&).WinEdit(&Agent Name:&).Set &mercury& Dialog(&Login&).WinEdit(&Password:&).Set &mercury& Dialog(&Login&).WinButton(&OK&).Click UFT的对象管理机制? ? ? ? ?UFT实现自动化测试的原理 对象仓库 Object Spy的使用 添加对象到对象仓库 脚本代码解读 如何认识对象?? 如何识别他? ? QTP实现自动化测试的原理n 封装真实被测对象并转化为QTP对象到对象库中; n 对比对象库里的对象鉴别属性和运行时的真实被测对象的属性; n 如果一致则对对象进行操作,不一致则提示对象无法识别。 ? QTP实现自动化测试的原理? 获取被操作对象的属性信息 ? 使用唯一的对象名在对象仓库中记录该对象 ? 将对象的全部属性信息存放在对象仓库中 ? 标识关键属性信息 ? 在脚本中记录对象名称和相应的动作录制测试脚本? 从脚本中获得对象名称(Item字段) ? 在对象仓库中找到该对象,并获取其关键属性 ? 根据关键属性信息在被测程序中定位该对象 ? 根据脚本中录入的动作和取值执行相应的操作 (Operation字段和Value字段)运行测试脚本 ? 对象仓库 Resouces- Object Repository用来存储QTP测试过程中所识 别的对象 在QTP中,每一个测试都对应 着一个对象仓库 测试对象的关键属性值发生 改变 测试人员就要经常维护对象 仓库 ? Object Spy的使用使用Object Spy获取对象的 属性当目标对象 未被激活,可长 按CTRL键,使用 鼠标激活对象 ? 添加对象到对象仓库 知 识 案 例创建共享对象仓库文件导出Test1的Action的对象仓库文件 Test1_Action1.tsr 代 码 实 践 一Calc 使用共享仓库要求:1. 2. 3.录制Calc “5+3=”保存为Calc_Test1 创建Calc_Test2 不录制脚本,使用共享仓库的方法在 Calc_Test2完成 “35+53=”的代码 WinApp 常用对象知 识 讲 解 序号 1 2 3 4 5 WinButton对象 WinEdit对象 WinList WinRadioButton Windows对象 描述 Windows的对话框控件 按钮 是常见的输入框 是指列表控件 是指单选按钮控件 方法 Activate Click Set Select Set QTP录制Web系统? ?Mtours 系统的介绍 输入数据参数化 知 识 讲 解Mtours 系统的介绍Mtours是QTP自带的 Web 飞机订票系统,包括: 登录系统、创建订票、打开订单、删除订单等功能。 是QTP的一个Demo程序。 课 堂 练 习Mtours系统的使用? ? ? ?登录Mtours系统 在Mtours系统中创建订单 在Mtours系统中打开订单 在Mtours系统中删除订单 知 识 案 例查看运行手工启动录制的代码‘启动代码 SystemUtil.Run &C:\Program Files\Internet Explorer\iexplore.exe&,&&,&C:\Documents and Settings\Administrator&,&open&“ ‘登录系统 Browser(&Welcome: Mercury Tours&).Page(&Welcome: Mercury Tours&).WebEdit(&userName&).Set &amber& Browser(&Welcome: Mercury Tours&).Page(&Welcome: Mercury Tours&).WebEdit(&password&).SetSecure &50641dea5f90aee359f631f0& Browser(&Welcome: Mercury Tours&).Page(&Welcome: Mercury Tours&).Image(&Sign-In&).Click 28,9 MISSION之苹果六代 码 实 践 二标题买苹果六!步骤A.购买苹果六 1.打开www.jd.com 2.在商品搜索框输入“iphone6” 3.把第一个搜索结果加入购物车 知 识 讲 解Web 常用对象序号 1 2 3 4 5 6 7 8 Web对象 Browser Page WebCheckBox WebRadioGroup WebEdit WebButton WebList Link index name name name text name Text 推荐识别属性         Set Click Select Click 方法 插入 检查点 知 识 导 入为什么要插入检查点? 根据测试理论知识,分析我们目前所运行的测试代 码有什么问题?? 没有预期结果执行了测试,却不知道被测系统 的功能是否满足需求 知 识 导 入什么是检查点?? 将特定属性的当前数据与期望数据进行比较,用于判定被测程序功 能是否正确 。 QTP检查点实现原理 录制时,根据用户设置的验证内容,记录数据作为基准数据 回放时,QTP捕获对象运行时的数据,与脚本中的基准数据进行 比较 如果基准数据和运行数据相同,结果为Passed,反之为Failed.? 知 识 讲 解检查点的类型表一检查点的类型标准检查点 图像检查点描述检查对象的属性值 检查图像的属性值用法示例检查是否选中某单选按钮 检查图像源文件是否正确检查文本字符串是否显示在 文本/文本区域检 检查预期的文本字符串是否显示 网页或应用程序窗口中的适 查点 在网页或对话框上的预期位置 当位置 知 识 导 入检查点函数:CheckPropertySyntax object.CheckProperty (PropertyName, PropertyValue, [TimeOut]) Return Type A Boolean value. b=obj.CheckProperty(&text&,&qa地质勘探总监&,20) verify=Browser(“***系统”).Page(“***系 统”).Frame(“Frame”).WebElement(“刷新成 功!”).CheckProperty (“innertext”,“刷新成功!”,25) 用编程的方式创建检查点知 识 导 入使用对象的CheckProperty函数步骤:a. 先把要检查的属性所属对象添加到对象库中 b. 用spy工具探测出属性的名字和对应的值 c. 使用对象的绝对描述(包含对象),格式: xxx.checkProperty “属性名” , &属性值&, n(设置检查点 的超时时间,毫秒) 属性值可以常量或参数化 代 码 实 践 三Mtours检查注册用户是否成功要求: 1. 2. Mtours中录制注册操作,新建保存 为Register 插入标准检查点 代 码 实 践 四Mtours检查登录是否成功要求: 1. 2. Mtours中录制登录操作,新建保 存为Login 插入图像查点 代 码 实 践 五Mtours检查新建订单是否成功要求: 1. 2. Mtours中录制登录、新建订单操 作,新建保存为NewOrder 插入文本检查点 代 码 实 践 六Mtours检查新建订单是否成功要求: 1. 2. Mtours中录制新建订单操作,新 建保存为NewerOrderweb 插入检查点函数 “输入数据 DataTable类型的参数化”44 知 识 导 入为什么要参数化? 当想要测试使用两位数加法器时,遇到什么问题??需要在代码中录制重复相同的业务流 程可以把输入数据设置为可变的值 吗? 知 识 导 入什么是参数化参数化就是一张包含多组数据的参数表,使之替换录制的脚本 中的相应常量值,这样,在脚本运行的时候,就会使用参数表 中的数据来代替录制的常量值 由于参数表中包含了多组数据,所以执行测试时,会多次自动 运行脚本,每次使用不同组的数据来代替脚本,这个运行次数 就是参数表中的记录数,而在Mercury的测试工具中,每执行 一次测试,称为一个反复。 知 识 案 例对Flights的登录数据参数化要求: 1. 被测系统:Flights2. 测试要求:使用Datatable Type实现Dialog Login中 用户名,密码输入的参数化 知 识 讲 解方法一:先锁定要参数化的数据,再创建DataTable参数DataTable类型参数化方法方法二:先创建DataTable参数, 再锁定要参数化的数据 课 堂 练 习对Flights的创建订单数据参数化要求: 1. 被测系统:Flights 2. 测试要求: a 使用Datatable Type实现Flyfrom 与 FlyTo 数 据输入的参数化 b 使用Random Type 实现Passengers的参数化 代 码 实 践 七DataTable类型的检查点参数化案例对两位数加法器实现功能自动化 测试: 1. 对两个加数按照侧表进行参 数化 2. 检查预期结果是否与实际结 果一致 用例编号 1 2 3 4 5 6 7 8 输入数据 90+50 -20+(-30) 70+(-50) -80+20 -99+98 99+(-98) 98+(-99) -98+99 预期结果 140 -50 20 -60 -1 1 -1 1 谢谢! Thanks!
更多搜索:
赞助商链接
All rights reserved Powered by
文档资料库内容来自网络,如有侵犯请联系***。QTP Tutorials – 25+ HP Quick Test Professional (QTP) Training Tutorials
Today we are publishing part one of a multi-part guest post series on HP Quick Test Professional (QTP). In this multi-part QTP training series we’ll be covering all QTP tutorials and concepts in detail with adequate illustrations. Our expert author Swati S. will be helping us to bring this series for our readers.These QTP tutorials are designed for beginners to advanced users. Starting from QTP basics you will learn advanced scripting all with practical examples for your easy understanding.NOTE: Below text tutorials are enough for you to get started learning on QTP automation tool. But if you are interested in hands-on LIVE QTP training please check our comprehensive QTP online course by the experienced professionals. Click on below image to view more details about this course.Also Check Our Online QTP Training Course Here:
Considering the big list of these , we’ll be publishing new articles frequently. Keep track of all articles in this Quick Test Professional Online training series so that you won’t miss any topic. Follow the topics closely, practice at home on QTP trial version and ask your questions in respective article comment section. We will make sure all relevant questions get answered.If you are an expert QTP user please share your experience to improve this QTP training series by discussing advanced QTP concepts and answering readers’ questions.QTP Training Series Tutorials:QTP Introduction:Tutorial #1 –
Tutorial #2 –
Tutorial #3 –
Tutorial #4 –
Tutorial #5 –
Tutorial #6 –
Tutorial #7 –
(Must Read)Tutorial #8 –
Learn VB Scripting:Tutorial #9 –
Tutorial #10 – QTP Checkpoints:Tutorial #11 –
Tutorial #12 – Tutorial #13 – Tutorial #14 – Tutorial #15 – Tutorial #16 – Test Automation Frameworks:Tutorial #17 –
(Must Read)Tutorial #18 – Enhance Your Tests:Tutorial #19 – Tutorial #20 – Tutorial #21 – Tutorial #22 –
Tutorial #23 –
Tutorial #24 –
Tutorial #25 – Test Your Understanding:*****Here is the first article in this QTP training series – “Introduction to QuickTest Professional (QTP)”Introduction to QuickTest Professional (QTP)What is QTP?HP’s Quick Test Professional (QTP) is a software that facilitates Automation Testing for software applications – Functional and Regression testing to be more specific. QTP comes with a user interface that can be considered an Integrated Development environment (IDE) for the test itself. The IDE has various features that aid the tester to develop a comprehensive script which would successfully validate the purpose of the test. All these features will be discussed in detail as we proceed through the series of these articles.Some of the important aspects of QTP:It uses VB Script as its scripting language. (A scripting language is one that gets interpreted at runtime)QTP runs only in a windows environment.The current version of QTP is 11.0 (Latest version Unified Functional Testing - UFT 11.5)The technologies it supports are Web, Java.Net, SAP, Oracle, Siebel, PeopleSoft, Web Services, and many major languages. Although some of the older versions don’t support all the technologies listed.How does it work?
The basic test creation method is record and playback. What does this really mean? Let’s talk about ‘Record’ first. When a tester launches QTP and performs a series of operations on the AUT (Application under test) QTP generates lines of code that corresponds to each operation performed. This will be the basic test script. Moving on to ‘Playback’. When the test script created is run, it performs the exact same operations on the AUT thus playing back the sequence of steps already recorded.E.g.: When I launch QTP and try to access the login page of a web-based email program, I enter the login ID, Password and press the OK button. These actions are recorded in their equivalent VBScript lines of code in the QTP IDE. When I save this test script and play it back, QTP will enter the same login ID, Password I entered before and clicks on the OK button for me.Now this being the gist of the basic test creation technique, record and playback are not always sufficient to a robust test script. The tester will have to use the other features in the IDE in conjunction with a little bit of his programming skills to achieve the required results.There are various technical aspects to be taken into consideration before we attempt to record and playback, like the state of the AUT, synchronization, the exact menu options, the exact code that QTP generates etc. We will get to that as soon as we discuss the basic concepts of the tool itself.Here’s how all this works. QTP identifies the various objects in the AUT by a name or handler ID or any other unique property/properties that the object possesses. During the record phase it captures all these properties and during playback, it performs the desired operations like a mouse click, checkbox checking etc. on these objects.What will you need to get started with QTP?A valid QTP license or in the case of a learner a trial version on their computer.QTP Download: Here is a link to download the QTP trial version: .In the above link, go to the ‘Trials and Demos’ tab and select the ‘HP QTP Essentials 11.0 English Evaluation (web GUI Testing only) option’. You can also select the latest version HP Unified Functional Testing 11.50 CC English SW E-Media Evaluation. Let us know if you want more detailed instructions on downloading and installing QTP trial version on your machine.There are two kinds of licenses – Seat license and concurrent/floating license. Seat license is for a single machine at one time whereas a current license is for a particular number of concurrent users.Now that we have some background information about QTP, let’s examine the tool itself starting with the UI.QTP GUI:When a test is recorded or created it can be viewed in one of these two views:Keyword view: This view is a tabular representation of all the objects and the actions that are performed on them. Every row in the table is a step performed on the AUT and can be modified. Some of the most common columns displayed are item, operation, value and documentation.Expert view: As the name indicates, this view is for more technical users who would want to tweak the source code as per their requirements.Both the views are available simultaneously so the user can switch between them anytime during the test creation or modification.Let’s record a little something to get startedStep #1): Launch QTP. The first thing that comes up is an Add-in manager. It displays all the add-ins that are available and the user can check or uncheck the ones as needed. Active-X, Web and Visual Basic are available by default. (This feature can be turned off if required).Step #2) On Clicking OK in the Add-in Manager QTP start page comes up. (click on image to enlarge)Step #3) On choosing “Record” option (F3 key) the ‘Record and Run settings’ screen comes up with ‘Web’ and ‘Windows Application’ Tabs. Click OK without changing any settings. However, all the features of this screen will be discussed at length later on.Step #4) For our example, I am going to launch the ‘Flight’ application from the samples that come with QTP. I am going to enter the ‘Agent Name’ and ‘Password’ in the Login screen. Now, let’s examine the code it generates.The following is the keyword view. As you can see, the actions are in the form of a table with columns: Item, Operation, Value and Documentation. Item corresponds to the object in the AUT on which we performed an action, the operation is the action itself, a value is a data we set the particular object to and documentation is more or less like a description. (click on image to enlarge)The corresponding keyword view to the same test is as follows. As you can see this view contains the source code for all the actions performed.Step #5) The code can be manipulated from either of these views.Conclusion:Here is a list of everything we discussed in this article:QTP is a software that aids automated Functional and
of software applications. The current version runs only in a windows environment and uses VB script as a scripting language. The basic method for creation of a test is Record and Playback, although that’s not always sufficient. It comes with two kinds of licenses, seat and concurrent.The default add-ins are Active X, Web and Visual Basic. A test can be recorded on a Web or W the specific details are to be provided in the record and run settings pop-up window. The GUI provides two views, Keyword and Expert. Keyword view is a tabular form that shows details like the name of the objects, its value, and the operation performed etc. Expert view displays the performed actions on the AUT in the form of source code.Additional operations to be performed on the test objects can be added or deleted either from the Keyword view or programmatically from the Expert view. More details on this in the next article.About Author: This is Swati and with these articles, I am trying to establish a comprehensive learning experience for QTP beginners. Having worked for more than 4 years on QTP in my overall 8 years of life as QA, I realize that the potential for Automation Testing is immense. I attempt to exercise that very potential collectively with all our readers through these articles.Want to learn QTP from Experienced Professionals? Join Our Online Training Course: Please join and share this FREE QTP training series with your friends. Ask your questions in the comments below. Bookmark this page as we’ll be updating links to all QTP tutorials from here.
Online Training by STH
All articles are copyrighted and can not be reproduced without permission.& 2006 - 2017 Software Testing Help — Read our

参考资料

 

随机推荐