`

A guide to Image-Based Testing with HP UFT’s “Insight”

UFT 
阅读更多

Motivation

One of the main competitive advantages of HP Unified Functional Testing (UFT) is its wide support for different technologies. In fact this is probably my most reused PowerPoint slide:

 

p1.png

 

 

 

But even after supporting all of these technologies (and more), there are always technologies that that are too rare or complex to justify developing UFT support.

 

 

 

In order to bridge the gap, UFT 11.50 introduced Insight, an image-based form of automation. Insight uses an image in order to identify a test object and is fully integrated into UFT so it can leverage the full range of UFT capabilities such as Record, Learn and Visual Relations Identifiers to name but a few.

 

 

 

When creating a test we sometimes find that UFT provides good support for the whole application—except for one or two little steps. These one or two little steps may make or break the ability to automate the whole application. In these cases, it is best to mix traditional UFT tests with a couple of Insight steps to get the best of all worlds.

 

 

 

The power of Insight comes from the fact that it simply requires a graphical interface—the bare minimum that any GUI system supplies. This means that Insight can be used on unsupported technologies such as Flash, or even on a remote desktop connection.

 

 

 

For the rest of this post I’ll use the Windows Calculator to demonstrate Insight’s capabilities. But don’t allow the simplicity of the examples to distract you from the wide scope of applications that can be automated with Insight.

 

 

 

The Test

 

Usually UFT is able to give test objects descriptive names. This is done by looking at the test objects properties and using some heuristics to decide which properties are most likely to contain a value that will convey meaning to the test maintainer. However, an InsightObject’s description is based on an image, so UFT has no additional insight (oh the irony) into the properties of the test object and is therefore not able to give the object a descriptive name. To avoid a test that contains only objects with names that look like “InsightObject_2”, “InsightObject_3”, etc., UFT inserts the actual image of the test object into the script, which has the added benefit of making the test understandable and maintainable:

 

p2.png

 

(Tip: Double clicking the Insight image will open the test object in the object repository)

 

 

 

Recording

 

In order to activate Insight during a record session, change the Recording Mode selection to Insight Recording:

 

p3.png

 

 

 

 

 

While in the Insight Recording mode, mouse operations will create an Insight step. Keyboard actions, on the other hand, create WinObject.Type steps. The reasoning behind this is that when a mouse event occurs there are coordinates associated with it and UFT can try to understand which object was acted upon, based on the coordinates. Typing presents more of a problem since UFT cannot, in general, determine which object is in focus. Therefore, the text is associated with the top-level window in focus, for example:

 

 

 

 

 

Window("Calculator").WinObject("Text").Type "3"

 

 

 

 

 

The InsightObject does support the Type operation. You can use this method in a test to move the focus to a specific InsightObject before typing.

 

 

 

Test Maintainance

 

Part of the power of Insight is that it captures an image that gives a good representation of the relevant object. Unfortunately, this goal is hindered by the fact that many UI elements nowadays change their appearance when they are interacted with. If Insight captured the image of a UI element when it was hovered over, then UFT could not find it during a run session, because then the element would not be hovered over. For this reason, when recording, Insight captures several images and determines which is the most appropriate to use according to some heuristics. There are cases in which Insight guesses incorrectly, either about which image to choose, or about the bounding rectangle of the UI element. In these cases you can change the image UFT uses for the test object by clicking the Change Test Object Image button:

 

p4.png

 

 

 

This opens an editor that lets you select a different image from the image history, resize and adjust the location of the rectangle, exclude areas within the image, and modify the test object’s click point (for more details see UFT’s documentation).

 

p5.png

 

 

 

Exclude Areas

 

There are cases in which a UI control contains areas that change without affecting the functionality of the control, and therefore make the image less useful for identification purposes. Such areas may change at random (e.g. advertisements), be dynamically generated (e.g. weather forecasts), or contain text which is localized to different languages. By adding Excluded Areas to the image we can specify that only parts of the captured image should be matched against the application, and the other areas can safely be ignored:

 

p6.png

 

 

 

Similarity

 

Because applications tend to change over time, Insight does not use simple image matching. Instead, Insight looks for controls that are similar to the image in the description. The best match is always used. However, there is a threshold under which images are not considered to match. If you wish to change this threshold value you can add the similarity property to the InsightObject’s description.

 

 

 

Descriptive Programming

 

Insight can be used with descriptive programming as well as via the Object Repository. To use descriptive programming, provide a path to an image file as the ImgSrc property of the test object.

 

 

 

Window("text:=Calculator").InsightObject("ImgSrc:=C:\img.png")

 

 

 

The following image file formats are supported: PNG, BMP, GIF and JPEG.

 

 

 

Conclusion

 

I hope this introduction to Insight object identification provides enough information on how, why and when you should start using this feature. Please let us know how useful you find Insight and what problems it solves for you by leaving a comment in the box below.

 

You can download HP Unified Functional Testing here.

 

http://h30499.www3.hp.com/t5/The-Future-of-Testing-Blog/A-guide-to-Image-Based-Testing-with-HP-UFT-s-Insight/ba-p/6355855

分享到:
评论

相关推荐

    【自动化测试工具】UFT_12.01_使用帮助.pdf

    本文档是 HP Unified Functional Testing (UFT) 12.01 的用户指南,旨在帮助用户了解 UFT 的功能和使用方法。本文档分为九章,涵盖了 UFT 的概况、GUI 测试、API 测试、业务流程测试、测试文档管理、UFT 窗口布局、...

    UFT14.52下载地址.zip

    【UFT14.52】是HP公司(现已被Micro Focus收购)推出的自动化功能测试工具,全称为Unified Functional Testing,之前被称为QuickTest Professional(QTP)。这个版本的UFT是一个强大的软件测试解决方案,专为功能...

    UFT_12.01_UserGuide_中文版

    Quicktest Professional简称QTP,现在惠普又将它改名为:UFT(统一功能测试),这是一个侧重于功能的回归自动化测试工具,旨在帮助开发团队注重早期阶段的测试,改善测试实践使得过程更为高效,帮助开发人员和测试...

    UFT Mobile testing with perfecto mobile

    标题中“UFT Mobile testing with perfecto mobile”意味着本篇文档是一份指南,用于介绍如何使用HP的UFT(Unified Functional Testing)工具结合Perfecto Mobile来开展移动终端自动化测试。这里,UFT作为一款广泛...

    HP 11.5 UFT 破解

    HP UFT11.5 免费无限使用,下载后双击执行就OK了。

    UFT_12.01_UserGuide_中文.pdf

    UFT(Unified Functional Testing)是一款功能强大且功能丰富的自动化测试工具,由 Hewlett-Packard(HP)公司开发。UFT 12.01 用户指南为用户提供了详细的使用指南,帮助用户快速上手 UFT,提高测试效率和质量。 ...

    ebook-agile-software-testing.pdf

    这包括了开源和商业支持的工具,如OATS(Oracle Application Testing Suite)、LoadRunner、QTP(Quick Test Professional,后更名为UFT - Unified Functional Testing)、Rational以及Selenium生态系统等工具的发展...

    Software_HP_UFT_12.00_MLU_T6510-15082.part1.rar

    Software_HP_UFT_12.00_MLU_T6510-15082文件分割成两个压缩包,必须凑齐两个才能解压缩使用: Software_HP_UFT_12.00_MLU_T6510-15082.part2.rar https://download.csdn.net/download/weixin_43800734/79742705 ...

    UFT11.5安装包

    UFT,全称Unified Functional Testing,原名HP QuickTest Professional(QTP),是 Hewlett Packard(现HPE)公司推出的一款功能强大的自动化测试工具。UFT11.5版本是其历史上的一个重要里程碑,尤其对于中文用户,...

    UFT_12.01_UserGuide_中文用户手册.pdf

    根据提供的文件信息,下面是关于UFT_12.01(统一功能测试)软件的中文用户手册的详细知识点介绍。 ### UFT简介 UFT(统一功能测试)是HP公司提供的自动化测试工具,之前被称为QTP(快速测试专家)。它主要用于功能...

    Software_HP_UFT_12.00_MLU_T6510-15082.part2.rar

    Software_HP_UFT_12.00_MLU_T6510-15082文件分割成两个压缩包,必须凑齐两个才能解压缩使用: Software_HP_UFT_12.00_MLU_T6510-15082.part1.rar https://download.csdn.net/download/weixin_43800734/79742701 ...

    xml转换uft-8格式工具(32位)

    将xml格式数据转换为uft-8格式的字符串数据,主要用于接口测试时,传递xml数据时,需要uft-8格式的xml数据,方便于测试人员的一个小工具

    Software_HP_UFT_12.00_Compressed_Package_for_the_Web_T6510-15083

    Software_HP_UFT_12.00_Compressed_Package_for_the_Web_T6510-15083.exe

    UFT中文帮助文档

    **UFT(Unified Functional Testing)**,全称统一功能测试,是Micro Focus公司推出的一款强大的自动化测试工具,尤其适用于企业级的功能测试和回归测试。它支持多种应用类型,包括Web、桌面、移动以及各种企业级...

    UFT(QTP) 教程&手册

    UFT,全称Unified Functional Testing,以前称为QuickTest Professional(QTP),是HP(现已被Micro Focus收购)开发的一款自动化测试工具,广泛应用于软件测试领域,尤其是功能测试和回归测试。 UFT教程涵盖了基础...

    QTP(UFT)12.01版本安装包及永久使用方法

    QTP(Quick Test Professional)是一款由Mercury Interactive开发的自动化测试工具,在2006年被惠普公司(HP)收购后,逐渐演变为UFT(Unified Functional Testing)。随着技术的发展,UFT已成为业界领先的自动化...

    js将中文转换成UFT8

    JavaScript是一种广泛应用于Web开发的脚本语言,它在处理字符编码时,特别是中文字符,可能会遇到一些挑战。本文将深入探讨如何使用JavaScript将中文字符转换为UTF-8编码,这在处理多语言内容或者与服务器进行数据...

    实验五 UFT-功能测试工具实验报告1

    【UFT功能测试工具实验报告】是针对自动化测试工具HP Unified Functional Testing(UFT)的一次实践操作,主要目的是让使用者熟悉UFT的基本操作流程,包括创建测试脚本、录制与编辑脚本、回放测试、导出脚本、对象...

    2-UFT设置检查点的操作

    UFT(Unified Functional Testing),原名QTP(QuickTest Professional),是HP(现Micro Focus)公司开发的一款功能强大的自动化测试工具,主要用于自动化测试Web应用、桌面应用和移动应用等。UFT支持多种脚本语言...

Global site tag (gtag.js) - Google Analytics