`
kuwoleft
  • 浏览: 1075055 次
文章分类
社区版块
存档分类
最新评论

LoadRunner9.5新特性

 
阅读更多

注:

1、本文最早发布于ITPub(新版LoadRunner9.5:简化使用增强安全

2、目前LR的最新补丁版本是9.52

最近HP发布了LoadRunner9.5。新版本的LoadRunnerVuGenControllerAnalysis三个模块中都有所增强,添加了一些新特性。

下载和安装

HP的网站上,LoadRunner9.5已经可以从下面的网址下载试用:

https://h10078.www1.hp.com/cda/hpms/display/main/hpms_content.jsp?zn=bto&cp=1-11-126-17^8_4000_100__

安装过程与以前版本基本一致,注意需要安装.NET Framework 3.5。安装时发现有错别字,在选择安装类型时,“完成”应该为“完全”,这么明显的错误HP的测试人员居然没有发现,该打屁股,哈哈。

安装完成后打开VUGen,可以发现Start Page略有改变,左边区域4个大图标按钮分别代表新建脚本、打开脚本、从模板创建脚本,还有新加入的功能“Protocol Advisor”。

协议“顾问” - Protocol Advisor

Protocol AdvisorLoadRunner9.5新添加的功能,你可以使用Protocol Advisor来帮助你决定采用什么样的协议来录制脚本。Protocol Advisor可以扫描你的应用程序,检查其中使用到的协议,并把他们显示在列表中,列出来的协议可以作为指引,指导我们应该采用什么样的协议来录制应用程序。

测试新手在使用LoadRunner时常常问的问题是“为什么我录制不了脚本?”、“我应该采用什么协议来录制?”,现在有了Protocol Advisor,问这些问题的人应该会少很多了吧!与其盲目选择协议去录制,不如在录制之前先运行Protocol Advisor,让Protocol Advisor告诉你应该采用什么样的协议。

在“预录制”过程中,Protocol Advisor记录所有找到的协议,然后把他们从高层次到低层次的顺序列出来。

但是需要注意的是,Protocol Advisor也不是万能的,不可尽信,例如它通常都会把COM/DCOMJava.NETWinSocketLDAP这些协议列出来,但是未必适合选择作为录制的协议。

作为性能测试工程师,深入了解被测试的应用程序的开发语言、采用的架构、业务流程中使用的协议,这些知识都是必不可少的,另外,多与开发人员、设计人员充分沟通,我想即使没有Protocol Advisor,我们也能比较合理地选用恰当的协议来录制和开发性能测试脚本。

广域网模拟 – WAN Emulation

通过广域网模拟,我们可以比较精确地测试部署到广域网上的产品的点到点性能。通过在测试环境的局域网中引入广域网的特点,例如延时、丢包、链接错误等,你可以拥有一个更贴近真实部署环境的性能测试环境。

其实在测试工具中模拟网络环境不是什么新鲜事,在VSTS的负载测试工具中也有网络组合设置的功能。

对于同一个Web应用程序,用户可能通过不同的网络类型来访问。负载测试如果想真实地模拟这种情况,则需要进行网络组合的配置。VSTS的网络组合设置支持的网络类型包括:

q LAN

q T3 6.0Mbps

q T1

q Cable/DSL 1.5Mbps

q Cable/DSL 768k

q Cable/DSL 384k

q Dial-up 56k

q Dial-up 33.6k

q Dial-up 28.8k

负载测试通过在测试中注入等待时间来模拟不同的网络带宽的情况,通过指定分发来指定虚拟用户使用某种网络类型的概率。在LoadRunnerRun-time设置中,也有Network设置这一项。

而对于广域网的模拟,LoadRunner在以前的一些版本中,WAN Emulation也早就曾经出现过(上一次看到WAN Emulation的身影是在2005年发布的8.1版本上),现在HP采用了不同的策略,不在LoadRunner中绑定WAN Emulation的功能,而是让用户自己选择和引入HP的第三方合作伙伴的产品,例如ShunraVE Desktop

分析人士认为这种伙伴关系给软件开发者和QA提供了一种新层次的软件测试能力(参考EMA的分析报告《Shunra Partners with HP, Microsoft to Provide Developers with View of Application Performance Over the Network》)。

更安全的测试环境 – Secure Channels

HP认为在负载测试的环境中,防止黑客的攻击是很重要的,通过安全通信通道来确保机密性、可信性。在LoadRunner9.5中,引入了Secure Channels机制,可以在ControllerLoad Generator之间创建安全的通信通道,防止黑客的网络攻击。

通过在参与通讯的主机上设置相同的Key来建立安全的通讯通道,如果Key不同的话,走的就不是安全通道了。

可以通过Host Security Setup工具来设置安全通讯。对于所有远程主机的安全设置,LoadRunner9.5还提供了Host Security Manager工具来管理。

自定义测试结果的分析 - Analysis API

新版本的LoadRunner中,Analysis模块暴露了新的API集,可以用于提取和分析负载测试数据。通过这些API,我们可以自己编写程序,从测试结果中创建analysis session、分析analysis session中的原始数据,提取关键session的度量数据。

这样的话,我们可以自己编写程序执行Analysis的某些功能,提取数据给外部的其他程序或软件使用。例如,我们可以让analysis session的创建和分析在无人值守的情况下进行、自己定义测试数据的提取和分析方法。

LoadRunner9.5的安装目录的/SAMPLES/AnalysisAPI目录下,提供了一个样例程序。

通过创建.NET项目,加入Analysis.Api.dll Analysis.ApiSL.dll Analysis.ApiLib.dll3DLL就可以使用LoadRunnerAnalysis API了。例如下面的C#代码用于创建LrAnalysis这个主对象并打开一个Session

/*

Create main object

The first action in an application is to create a main object.

*/

public void CreateAnalysisApiObject()

{

LrAnalysis analysisApi;

analysisApi = new LrAnalysis();

//an object for easy access

Session currentSession = null;

currentSession = analysisApi.Session;

//Here we can start work with API. See other "How to…topics

}

如果想打开一个已经有的session文件,则可以参考下面的代码:

/*

Open session

The following code shows how to open asession from an existing LRA file.

For more information about the analysisApi object, see "Create main object".

For more information about RunTimeErorrs, see "Set RunTimeErrors to "Silent mode".

*/

public bool OpenSession(string filename)

{

//open session from specified .lra file

//You must setup RunTimeErrors object to "Silent mode"

bool result = analysisApi.Session.Open(filename);

if (result)

{

try

{

//work with opened session

}

finally

{

//You must always close opened session

analysisApi.Session.Close();

}

}

return result;

}

打开Session后,就可以参考API的对象模型来编写程序操作Session中的对象了。

如果想把测试结果中的图表导出到excel文件,则可以使用API中的Exporters,例如下面的代码所示:

/*

Export to CSV

The following code shows how to export Graph, Series, or Dictionarie into a CSV file.

*/

public void SaveGraphToFile(Graph graph, string graphFilename,

IBaseDictionary dict, string dictFilename,

Series series, string seriesFilename)

{

analysisApi.Exporters.CSV.ExportGraph(graph, graphFilename);

analysisApi.Exporters.CSV.ExportDictionary(dict, dictFilename);

analysisApi.Exporters.CSV.ExportSeries(series, seriesFilename);

}

小结

从初步的试用结果来看,LoadRunner9.5提供的Protocol Advisor这个新功能对于性能测试新手来说会比较有用。

负载测试可以说是一门高深的“模拟学”,对真实使用环境的模拟越逼真,你的负载测试就越成功。要想比较真实地模拟广域网的环境,WAN Emulation这个功能对于大型跨地域的网络应用系统的负载测试而言必不可少。

而对于Secure Channels所提供的创建安全测试通讯环境的机制而言,则见仁见智了,个人认为对于那些负载测试需要在生产环境中进行,或者需要暴露在公网中进行并且对于安全保密而言比较关键的应用系统的测试还是比较有用的。

Analysis API是我比较喜欢的一个新特性,它提供了灵活的、可定制的测试结果分析能力,给了我们创建自己的Analysis Session分析报告的机会。

补充LR9.51新特性说明:

Version 9.51 provides the following feature enhancements and fixes. For more details about these features, refer to the online documentation:

  • HP Performance Monitoring Best Practices. New guide that provides concepts, guidelines, and practical examples on best implementation of performance testing monitoring in various environments. Available from <HP LoadRunner installation directory>/help/Monitoring_BP.pdf.
  • SiteScope 10.0. Added support for SiteScope 10.0 with the following limitation:

If you are using the SiteScope monitor engine in the Controller, and you specify a monitored machine name using a fully qualified domain name or IP address, the Controller will fail to display the default graph measurements. Workaround: If you manually add any additional measurement, all the measurements will be displayed. Alternatively, specify only the actual machine name (without any domain suffix). Note: A patch will be delivered by SiteScope to fix this limitation.

  • Citrix window sizes. Citrix Protocol supports additional window sizes (including widescreen resolutions). This can be configured in the Recording Options dialogue box.
  • Citrix XenApp Plugin for Hosted Applications 11 supported. Citrix Protocol now supports the XenApp Plugin for Hosted Applications version 11.
  • TCP mode support. TCP mode is now fully supported by the Webtrace utility and the Network Delay Time monitor on Windows platforms (including XP and Vista).
  • Flex Externalizable Run-Time Settings. New options that display the settings used during script recording and allow you to edit the location of the JAR files.
  • New Diagnostics graph in Analysis. The new J2EE/.NET – Probes Metrics graph displays performance metrics collected by HP Diagnostics probes. Metrics include JVM related data such as Heap usage and Garbage Collection, application server specific metrics, JDBC (Java Database Connectivity) metrics, and more.
  • New throughput graph in Analysis. In addition to the existing throughput graph, a new throughput graph, Throughput (MB), has been added to enable viewing throughput in megabytes.
  • New date formats in Analysis. New date format configuration options have been added in Analysis (Tools > Options > General) for newly created sessions. The new options are Traditional Chinese and Local Regional Options (the date format as defined in the current user's regional settings).
  • Post collate command in Controller. In the post collate command, you can now use the %ResultDir% keyword to refer to the scenario's results directory.

补充说明LR9.52补丁版本:

Summary

Change Request: SR3605993313

Analysis - Resolved failure to connect to

HP Quality Center 9.2.

Change Request: SR4600906600

Analysis - Resolved issue of blank data in graph after

reopening result containing measurements that were renamed.

Change Request: SR4601606265

Analysis - Moved NAN data point notification to

the log file.

Change Request: SR4602777075

Analysis - Support work with Analysis sessions on machines

with different locales (I18N).

Change Request: SR4602820683

Analysis - Resolved issue of report generation failure

when there are a large amount of transactions.

Change Request: SR4601892713

Citrix - Resolved replay failure on load generator when

the Default Image Sync Tolerance is not set to Exact

in the run-time settings.

Change Request: SR1604422556

COM/DCOM - Resolved issue of code generation creating

script with incorrect escape characters.

Change Request: SR3604590633

Controller - Resolved issue of Run-Time Viewer dialog

box (Show Vuser) displaying blank screen when running

a scenario with a remote load generator.

Change Request: SR3604847785

Controller - Resolved scenario termination when script

contains unique parameters.

Change Request: SR2606555891

Flex/AMF - Added missing response parameter for

flex_ping function.

Change Request: SR3605266306

Flex/AMF - Resolved issue during replay of

flex_amf_call if the script fails to find

one of the externalizable JAR files.

Change Request: SR3605457204

Flex/AMF -

* Resolved issue, in Tree View,

of VuGen deleting steps containing parsing errors.

* Resolved code generation of strings

with XML statements containing CDATA element.

Change Request: SR4600056769

Flex/AMF - Resolved issue of issue during

replay of flex_rtmp_send.

Change Request: SR4600132257

Flex/AMF - Added support for code

generation on I18N environments.

Change Request: SR4600297598

Flex/AMF - Resolved issue with RTMP handshake

during code generation.

Change Request: SR4601285762

Flex/AMF - Resolved issue of replay failure on

WriteObjects error.

Change Request: SR4603400413

Flex/AMF - Resolved issue with RTMP SET CHUNK SIZE

control message.

Change Request: SR4603588272

Flex/AMF - Resolved issue of replay snapshots not

being created when capturing data on WinInet level.

Change Request: SR3605965394

HP Quality Center Integration - Resolved issue of

Parameter List dialog box in HP Quality Center not

displaying parameters when running on Vista.

Change Request: SR4602917284

Microsoft .NET - Resolved recording issue.

Change Request: SR3606385127

Oracle (2-Tier) - Resolved correlation failure of

null terminated values.

Change Request: SR4600629016

Oracle (2-Tier) -Resolved replay failure when actual

BLOB size is bigger than the value used while recording.

Change Request: SR4600830598

Oracle NCA - Resolved issue during code generation

of messages with large strings.

Change Request: SR4601877435

VuGen - Resolved Tree view issue of deleting a bulk

of the soap:Body section.

Change Request: SR4602464478

VuGen -

* Resolved issue of VuGen shuting down in Tree

view mode when script contains large XML argument.

* Resolved issue of VuGen shuting down when trying

to open or perform a save as on a web services script.

Change Request: SR1604321605

Web (HTTP/HTML) - Resolved replay failure on https

when trying to connect on the same socket when socket

is closed by proxy server.

Change Request: SR2605064781

Web (HTTP/HTML) - Resolved issue of wrong step

arguments generated for requests that contain

'EncType' option with 'boundary' field.

Change Request: SR3605040249

Web (HTTP/HTML) - Resolved issue of socket not

closing properly during recording.

Change Request: SR3605335126

Web (HTTP/HTML) - Resolved replay failure

caused by missing CA chain message on SSL

environments.

Enhancement

Yes

LR_03012:

* Flex protocol enhancements.

Improved support of externalizable objects and

general protocol usability.

Updated user interface for Recording Options and

Run-Time Settings(Flex > Externalizable Objects node).

Added Code Generation Errors dialog box that displays

details about errors, as well as recommended actions.

(For details about these enhancements,

see the Flex documentation supplement (Flex.pdf),

located in the product installation dat directory).

* Web Services protocol enhancements.

The Web Services protocol now supports JMS messages

based on JMS topics and Windows authentication

for a user other than the one currently logged-in.

It also contains enhancements in WS-addressing,

and the signing and encrypting of SOAP headers.

* Install LoadRunner 9.52 on a

machine containing LoadRunner 9.51

* If you have a non-English Edition of

LoadRunner installed, installing any patch

which modifies the LoadRunner user interface

may cause non-English interface elements to

revert to the English version.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics