LoadRunner9.5新特性
注:
1、本文最早釋出於ITPub(新版LoadRunner9.5:簡化使用增強安全)
2、目前LR的最新補丁版本是9.52
最近HP釋出了LoadRunner9.5。新版本的LoadRunner在VuGen、Controller和Analysis三個模組中都有所增強,新增了一些新特性。
下載和安裝
在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 Advisor是LoadRunner9.5新新增的功能,你可以使用Protocol Advisor來幫助你決定採用什麼樣的協議來錄製指令碼。Protocol Advisor可以掃描你的應用程式,檢查其中使用到的協議,並把他們顯示在列表中,列出來的協議可以作為指引,指導我們應該採用什麼樣的協議來錄製應用程式。
測試新手在使用LoadRunner時常常問的問題是“為什麼我錄製不了指令碼?”、“我應該採用什麼協議來錄製?”,現在有了Protocol Advisor,問這些問題的人應該會少很多了吧!與其盲目選擇協議去錄製,不如在錄製之前先執行Protocol Advisor,讓Protocol Advisor告訴你應該採用什麼樣的協議。
在“預錄製”過程中,Protocol Advisor記錄所有找到的協議,然後把他們從高層次到低層次的順序列出來。
但是需要注意的是,Protocol Advisor也不是萬能的,不可盡信,例如它通常都會把COM/DCOM、Java、.NET、WinSocket、LDAP這些協議列出來,但是未必適合選擇作為錄製的協議。
作為效能測試工程師,深入瞭解被測試的應用程式的開發語言、採用的架構、業務流程中使用的協議,這些知識都是必不可少的,另外,多與開發人員、設計人員充分溝通,我想即使沒有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。
負載測試通過在測試中注入等待時間來模擬不同的網路頻寬的情況,通過指定分發來指定虛擬使用者使用某種網路型別的概率。在LoadRunner的Run-time設定中,也有Network設定這一項。
而對於廣域網的模擬,LoadRunner在以前的一些版本中,WAN Emulation也早就曾經出現過(上一次看到WAN Emulation的身影是在2005年釋出的8.1版本上),現在HP採用了不同的策略,不在LoadRunner中繫結WAN Emulation的功能,而是讓使用者自己選擇和引入HP的第三方合作伙伴的產品,例如Shunra的VE 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機制,可以在Controller和Load 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.dll這3個DLL就可以使用LoadRunner的Analysis 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:
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.
補充說明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
* 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.
相關文章
- 新特性
- Oracle11新特性——PLSQL新特性(七)OracleSQL
- Oracle11新特性——PLSQL新特性(六)OracleSQL
- Oracle11新特性——PLSQL新特性(五)OracleSQL
- Oracle11新特性——PLSQL新特性(四)OracleSQL
- Oracle11新特性——PLSQL新特性(三)OracleSQL
- Oracle11新特性——PLSQL新特性(二)OracleSQL
- Oracle11新特性——PLSQL新特性(一)OracleSQL
- 【ORACLE新特性】11G 分割槽新特性Oracle
- React 新特性React
- 新特性介面
- 新特性方面
- 10G新特性筆記之安裝新特性筆記
- Servlet 3.0 新特性Servlet
- Go 1.13 新特性Go
- Java 11新特性Java
- PHP 7.4 新特性PHP
- Java 17新特性Java
- Prometheus 2.21.0 新特性Prometheus
- Java 8 新特性Java
- Hadoop新特性Hadoop
- MySQL 8.0 新特性MySql
- C++新特性C++
- PostgreSQL 13–新特性SQL
- Java 8 新特性Java
- .NET 7新特性
- Django 2.0 新特性Django
- Java 8新特性Java
- MySQL 5.7新特性MySql
- Git 1.8.5 新特性Git
- JavaFX 2.2.4新特性Java
- C#新特性C#
- EJB 3.2新特性
- cassandra 1.0.0新特性
- JDK 5新特性JDK
- 玩轉iOS開發:iOS 11 新特性《Layout的新特性》iOS
- MySQL · 特性分析 · MySQL 5.7新特性系列一MySql
- C++11新特性(二):語言特性C++