测试工具QTP与WinRunner的比较以及适用范围(转)

上一篇 / 下一篇  2009-09-15 10:37:15 / 个人分类:测试自动化


本文是我很早以前整理的,因为今天在论坛上有位朋友问到相关问题,因此贴出来供大家参考。由于写作时间有点早,之后也没再深入学习过这两个工具,因此如果文中有错误之处,还望各位批评指正!

QTP,全称为Quick Test Professional,它与WinRunner同为MI公司开发的功能强大的功能测试工具。从时间上来看,WinRunner在1995年便已经推出,远早于QTP,而QTP直到2002年才正式推出。从MI公司提供的一些官方资料来看,虽然他们宣称暂时不准备淘汰WinRunner,但他们的宣传资料上又明确表示,QTP已经具备了WinRunner中几乎所有的特性,同时具备了一些独有的特性,并且总体来说,使用更简单、更易扩展和维护,推荐新用户使用QTP,并建议已使用WinRunner的老客户逐渐实现转换。由此看来,MI公司实际上已经有使用QTP逐步取代WinRunner的计划。更重要的是,QTP对J2EE,.NET架构的应用程序支持得比WinRunner要好(从我实际的试用过程中,也感到确实是如此),因此我认为,从我们公司的实际情况出发,针对产品综合部今后将逐步开展自动化测试的计划,QTP应该是一个比较好的选择。

不论是WinnRunner还是QTP,它们都是功能十分强大的测试工具,加上目前国内关于测试工具的培训和文档资料,实在是少之又少,因此要完全了解和掌握它们,绝不是一朝一夕的事情。在这里我只能就目前对它们的理解程度粗略地介绍一下二者的两点主要不同之处。

1.使用的脚本语言不同。WinRunner使用的是TSL语言,这是MI公司独有的语言,有特殊性,因此在学习上会有一定难度,不过好在它与C 语言比较类似,如果测试人员有一定的C语言编程基础,会相对容易一些。而QTP使用的则是微软的VBscrīpt语言,比较通用,而且也相对简单易学。从语言上的比较上来看,我个人觉得在编程能力上,WinRunner更胜一筹,因为它拥有相当丰富的C语言函数库,而相对而言,QTP则更大众化,它面向的是没有太多技术背景和编程经验的测试人员。

2、QTP8.0具有的一大特性:关键字驱动测试(keyword-driven testing)。它的具体操作方法我将有另外的文档详细说明,这里只是简单介绍一下。通过“关键字驱动测试”,测试人员不需要“录制”测试脚本,而可以改成“设计”测试脚本。即:先将应用程序的GUI对象添加到QTP的对象仓库(Object Repository)中,然后针对每一个需要操作到的对象设计每个测试步骤。我个人感觉,这的确是一个很酷的特性,它使我们可以不必实际去操作应用程序,就可以编写出测试脚本,这样做既节省了时间,而且还有一个更大的好处就是可以在应用程序还没有设计完成,或者由于出错无法正常执行的时候仍然可以编写我们的测试脚本。应用程序只需要有使用界面(UI),而不必实际运行,测试人员就可以开始建立测试脚本,为我们实施自动化测试赢得更充足的时间。而在 WinRunner中,虽然也可以采用先学习对象,然后编写代码的方式来完成测试脚本,但这样做要求测试人员对TSL语言比较熟悉才做得到,远不如QTP 来得简单。在实际的操作中我还发现,有些时候采用录制的方法无法捕获对应用程序的操作,此时改用关键字驱动测试却可以收到不错的效果。

3.相对WinRunner,QTP还具有很多优点,例如“数据表整合”,“Active Screen”,“point and click”,更容易参数化等等,但对于这几点我还没有深入的做过比较,如果今后我对此有了更多的体会和了解,我将再作整理。

自动化测试工具的选型第一步就是看该工具是否适用于本软件系统的开发语言环境,否则自动化实施就会功败垂成。如:我们有学员去一家公司,该公司是用的是c#开发的软件,他们在用wr座自动化测试,经常会遇到识别对象的问题,脚本运行失败等,就是一个典型例子,工具选型错误。

从上边来看,现在大多数说wr做c/s架构,qtp做b/s架构的测试这是一种错误的说法,应该说他们更适用于什么架构的测试,因为适用环境决定了他们可以做这些事情.

很多初入行的朋友使用测试工具进行功能测试的时候,总是会遇到QTP和WinRunner的选择问题,为什么同样一家公司会出两个功能类似的工具哪? 下面是一篇关于这两个工具的对比介绍,其实从我自己的经验来看,WinRunner虽然推出较早,但是因为一些功能的缺陷,导致后期很难推广,而Quick Test Professinal(QTP)虽然没有师兄WinRunner出道早,然后内功深厚,所以很受欢迎,而且Mercury公司以后的主要发展策略是QTP,虽然文章中说并没有计划Phase out WR,但是已经不再出新版本了. 针对这两个工具的3年左右的使用经验,我的感受是WR比QTP的逊色的地方主要是几点:

1. WR的对象管理不如QTP那么有效

2. WR的语言主要是基于类C的TSL,是Mercury发明的语言,明显不如基于VBscrīpt的QTP强

3. WR的稳定性不行,而且无意人为的干扰可能导致回放的失败

4. WR对Java的支持也不如QTP那么强

WinRunner vs. QuickTest Pro

Quick Comparison


11



Overview

Today Mercury has two functional testing tools – WinRunner (WR) and QuickTest Professional (QTP).WinRunner has been around since about 1995 while QuickTest Pro has been available since about 2002.We have lots of companies asking us “What’s the difference between WinRunner and QuickTest Pro?” and “If they are both functional testing tools from the same company, then which one of the tools should we use?”This document was developed as a short simple reference in helping to understand the basics about the tools in order to answer these two questions.

Mercury’s position on the two tools is this:

<!--[if !supportLists]-->*<!--[endif]-->The strategic direction for Mercury and its customers for Functional Testing is product integration. The new releases of QTP and WR improve already existing integration where customers can leverage complete WinRunner assets (scrīpts/functions) from QuickTest Pro without any modification to these assets.

<!--[if !supportLists]-->*<!--[endif]-->QuickTest Pro 8 has recently been released and WinRunner version 8.0 is planned for November 2004. There are no plans to phase out WinRunner.

<!--[if !supportLists]-->*<!--[endif]-->QuickTest Pro remains Mercury’sprimeproduct for best customer satisfaction and experience. For customers who need both products, Mercury continues to offer Mercury Functional Testing as a combined package of both product offerings. The Business Process Testing system will be extended to incorporate components designed in WinRunner for the WinRunner 8.0 release in November.



WinRunner Compared to QuickTest Pro

Environment Coverage Comparison:

<!--[if !supportLists]-->*<!--[endif]-->Common environments shared by both WinRunner and QuickTest Pro:

Web-Related Environments

IE, Netscape, AOL

JDK, Java Foundation Classes, AWT

Symantec Visual Café

ActiveX Controls

ERP/CRM

Oracle: Jinitiator, 11i, NCA

Custom Client Server

Windows

C++/C

Visual Basic

Operating Systems

Windows 98, 2000, NT, ME, XP

Legacy

3270, 5250 Emulators

VT100

<!--[if !supportLists]-->*<!--[endif]-->WinRunner Only Environments:

Custom Client/Server

PowerBuilder

Forte

Delphi

Centura

Stingray

SmallTalk

ERP/CRM

Baan

PeopleSoft Windows

Siebel 5, 6 GUI Clients

Oracle GUI Forms

<!--[if !supportLists]-->*<!--[endif]-->QuickTest Pro Only Environments:

ERP/CRM

SAP

Siebel 7.x

PeopleSoft 8.x

.Net

WinForms

WebForms

.Net controls

Web Services

XML, HTTP

WSDL, SOAP

J2EE, .Net

Multimedia

RealAudio/Video

Flash

Feature Comparison:

<!--[if !supportLists]-->*<!--[endif]-->Common features found in both WinRunner and QuickTest Pro:

Record/Replay

ODBC & Excel Connectivity

Code Editor & Debugger

Recovery Manager

Shared Object Repository

Rapid Object Import

Numerous Checkpoints

Analog

scrīpt & Function Libraries

<!--[if !supportLists]-->*<!--[endif]-->WinRunner Only Environments:

Function Generator

Database Integration

Run Wizard

TSL

MDI

<!--[if !supportLists]-->*<!--[endif]-->QuickTest Pro Only Environments:

ActiveScreen

TestGuard

Tree View

scrīptFusion

Data Table

VBscrīpt

Function Generator*

(coming in v7.0)

Run Wizard*

(coming in v7.0)



What We Recommend

QuickTest Pro is our functional testing tool of choice!

Most customers are in either of two situations:

<!--[if !supportLists]-->*<!--[endif]-->Existing WinRunner customers asking “Should we switch to QuickTest Pro?”

<!--[if !supportLists]-->*<!--[endif]-->New customers asking “Which should we get, WinRunner or QuickTest Pro?”

We have been implementing Mercury’s products since 1992 and have senior level expertise in WinRunner.We have been implementing WinRunner since the very first version of it.So like many existing WinRunner customers we have a huge knowledge investment in WinRunner ourselves.However we have worked on the Mercury development team on the QuickTest Pro 6.0 and 6.5 releases, and have solid real-world experience in implementing QuickTest Pro since the 6.0 release.We have found it to be a great tool to use and recommend it to all customers!Overall,we recommend using QuickTest Prounless for some reason you have to use WinRunner due to an unsupported environment not existing in QuickTest Pro.

Overall, QuickTest Pro is easier to use and implement for both technical and non-technical testers in comparison to WinRunner.QTP offers many features that are found in WinRunner, but are easier to use.QTP also offers many features not found in WinRunner that make test scrīpt creation, enhancement and maintenance easier.

Let’s quickly discuss some key issues:

<!--[if !supportLists]-->*<!--[endif]-->The WinRunner interface forces the user to look directly at TSL code.TSL is the WinRunner programming language developed by Mercury.It is based on the “C” programming language and therefore looks very similar.For testers who do not have a technical background, they are not always comfortable with having to always look at code.However QuickTest Pro offers a “Tree View” which is an icon-based view of the scrīpt.This is very easy to get used to and non-technical people adapt to it quicker and feel more comfortable working with it.For the technical user, they can always switch over to the “Expert View” in QuickTest and look directly at code, and program away using VBscrīpt.

<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->

<!--[if !supportLists]-->*<!--[endif]-->WinRunner uses TSL which is a proprietary language of Mercury.These types of languages can be very restrictive and you are limited on available resources.QuickTest Pro use the Microsoft programming language VBscrīpt which is very powerful, has lots of capabilities and there are lots of resources available.

<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->

<!--[if !supportLists]-->*<!--[endif]-->We feel that there are many more “point and click” features in QuickTest Pro than WinRunner.This makes its use easier.

<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->

<!--[if !supportLists]-->*<!--[endif]-->All the same features found in WinRunner are found in QuickTest Pro plus more.

<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->

<!--[if !supportLists]-->*<!--[endif]-->Data Table integration is much easier and simpler with QuickTest Pro.

<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->

<!--[if !supportLists]-->*<!--[endif]-->Data Driven Testing is easier with more options in QuickTest Pro.

<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->

<!--[if !supportLists]-->*<!--[endif]-->scrīpt enhancements are typically easier with QuickTest Pro because it has the Active Screen where the windows and objects in your application are captured for later use.Using a“point and click” capability you can easily interface with objects, their definitions and create checkpoints after having recorded a scrīpt – without having to navigate back to that location in your application like you have to with WinRunner.This greatly speeds up scrīpt development.

<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->

<!--[if !supportLists]-->*<!--[endif]-->QuickTest Pro currently has built in integration with WinRunner in order to be able to call existing scrīpts, which is great for customers who already have a large test scrīpt investment with WinRunner.Likewise WinRunner 8.0 is to have the ability to also call QuickTest Pro scrīpts.This eases the transition from WinRunner to QuickTest Pro for existing customers.

<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->

<!--[if !supportLists]-->*<!--[endif]-->Parameterization is much easier in QuickTest Pro and basically anything in QuickTest Pro can be parameterized (statements, checkpoints and the Object Repository).

<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->

<!--[if !supportLists]-->*<!--[endif]-->Capturing various output values is easier and simpler with QuickTest Pro.Using this capability with parameterization enables you to easily develop scrīpts thatcan do morein regards to testing.

<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->

<!--[if !supportLists]-->*<!--[endif]-->We have been implementing QuickTest Pro in real-world environments and have found it much easier to use, advance features are easier to implement and the scrīpt development is quicker.We really enjoy using QuickTest Pro and highly recommend it as the functional testing tool to use.

QuickTest Pro is our functional testing tool of choice!



WinRunner

Summary:

This product is a mature tool that has been around since approximately 1995.It interfaces with most of the leading development toolkits using the WindowsAPI and toolkit DLLs to interface with the “Application Under Test”.

WinRunner offers a recording feature that will watch the individual

TAG:

引用 删除 xiaoxiao126   /   2013-08-28 17:11:15
5
 

评分:0

我来说两句

我的栏目

日历

« 2024-03-24  
     12
3456789
10111213141516
17181920212223
24252627282930
31      

数据统计

  • 访问量: 6376
  • 日志数: 8
  • 建立时间: 2009-09-14
  • 更新时间: 2009-10-09

RSS订阅

Open Toolbar