1 Automated Performance Testing of Desktop Applications Introduction For the most part, performance testing is associated with Web applications. This area is more or less covered by a lot of articles and videos about how to use JMeter and other tools, which allow load generation and performance metrics capturing. But how do you test the performance of a Desktop application? Long story short, here are some basic requirements: • No sources of application (black box) • Any Windows application (usually these are resource intensive applications such as arhivators, backup utilities, etc.) • Different operations with the application under test and system performance tracking (RAM, CPU, and other metrics) • Notification about the system state when the user performs any action (for example, button clicks, message box pop-out (GUI events), etc.) By Ostap Elyashevskyy Automated Performance Testing of Desktop Applications
12
Embed
By Ostap Elyashevskyy Automated Performance Testing · PDF fileutomated erformance Testing of Desktop pplications 1 Introduction For the most part, performance testing is associated
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1Automated Performance Testing of Desktop Applications
Introduction
For the most part, performance testing is associated with Web applications. This area is more or less covered by a lot of articles and videos about how to use JMeter and other tools, which allow load generation and performance metrics capturing.
But how do you test the performance of a Desktop application? Long story short, here are some basic requirements:
Automated Performance Testing of Desktop Applications
2Automated Performance Testing of Desktop Applications
To show how everything works, here is one of the possible approaches to test the performance of Desktop applications.
Tool selection
UI testing toolInordertocaptureperformancedataduringuseractions,weneedtohandletheapplication under test and interact with it, in particular click on controls, emulate mouse and keyboards events, etc.
The selected tool should satisfy the following requirements:
Afterashortinvestigation,Ihavefoundtwopossibletools:SikuliandAl’exa.Bothareopen source projects, with more detailed features description and comparison to be found here.Asit’scapableofgrabbingperformancedataandintegratingwiththeNagiosmonitoringsystem,Al’exawasselectedasthemaintoolforUIperformancetesting.
Integration of UI and resource monitoring toolWindowsPerformanceMonitor(WPM)allowscustomcounterstobecreatedandsetthoughaproxywhichwillsendperformancedatafromAl’exatoWPM.Implementationofsuchaproxyisdescribedlater.
The system metrics are measured within the following operations order:
a.Navigatemenuandopenbenchmarkwindow
b.Performbenchmarkingfor10seconds
c.Stopbenchmarking
4Automated Performance Testing of Desktop Applications
Performance Monitor Counters set-upInordertotrackcustomactions,createperformancegroupsandaddperformancecountersforeachuserworkflow.IfyouarenotfamiliarwithWindowsPerformanceMonitor, take a glimpse at this short articledescribingthebasicsofWPM.
Havinganalyzedseveralsolutionsabouthowtosetcustomcounters,Ifoundit’sbettertodoitprogrammaticallyonC#.Therefore,Ihaveimplementedasmallcommand line utility based on this cool article.Downloadthefileshere:C#sources/executable.
5Automated Performance Testing of Desktop Applications
this command again, you delete an old group and create a new one with the new counters.Then,openPerformanceMonitorandcheckthenewlycreatedgroupwithcustom counters:
The operation of creating counters was separated for two reasons:
Proxy implementationNowit’stimetosetthecountersprogrammatically.Tosetthecounters’values,implementproxyin.NET(thereareprobablyothersolutionsimplementedonPython,so if you know any libs or better solutions, please share in comments or write me anemail).Fornow,downloadsources and build them or use a compiled library PerfMonitorProxy.dll.
This.NETlibrarywillbecalledbythescriptsinAl’exa(Python),soit’snecessary“tore-call”itintoa.NETcode.Moreinformationaboutbuildingandcallingunmanagedcode can be found here and here.Fornow,it’senoughtodownloadandusethelibrary.
Getting started with Al’exaTestsandinteractionwiththeGUIwillbeperformedbytheAl’exatool.Firstofall,installAl’exa.CreatingscriptsinAl’exaIDEisintuitiveandthelinkedgettingstartedmanual covers this aspect. Let me elaborate on the most important moments and comment on some code snippets.
Recording performance data to log fileThe previous chapter described capturing and showing results in real time mode. Usuallythisisneededtoscheduletestsandcollectresultstoanalyzeitafterwards.
ThecombinationofAl’exaandWPMresultsinapowerfulflexibletestandmonitoringsystem for Windows desktop applications. When tracking applications from different hosts,optforintegrationwithNagiosorothermonitoringsystems.Scriptsandcodeprovided in this article were created as a proof of concept and can be improved and applied according to your needs.
OstapElyashevskyyisaTestAutomationExpertatSoftServe. Hehasmorethan7yearsofexperience,2ofwhichareinsoftware development and 5 are in test automation testing. ThemainprojectsOstapworkedonaremobiletestautomationprojectsforbothAndroidandiOSplatforms,DekstopandWebprojectswherevarioustypesoftestingwereimplemented-fromfunctionaltoperformance/loadandstaticanalysis.Ostapbelieves
that automation should be applied not only for software testing, but also other activitieswheretimecanbesavedandautomationbringsbenefits:collectingmetricsof different kinds, implementation of helpful utilities such as bug migration utility or testresultssynchronizationwithtestmanagementsystem,etc.
Toachievethiswe’vebuiltastrongteamofthebrightest,mostinquiringmindsinthe industry, and we form close, collaborative relationships with our clients so we canreallyunderstandtheirneedsanddeliverintuitivesoftwarethatexceedstheirexpectations.