Sunteți pe pagina 1din 8

Apache JMeter HTTP(S) Test Script Recorder

This tutorial attempts to explain the exact steps for recording HTTP/HTTPS. For those new to JMeter, one easy way to create a test plan is to use the ecorder.

Jmeter configuration
Since JMeter !."#, recording has $een impro%ed to $etter handle em$edded resources and creation of certificates on the fly. To ena$le these features, JMeter uses &eytool utility 'a%aila$le in J (/J)*+ so you need to ensure your configuration is correct, read this wi&i page $efore starting, https,//wi&i.apache.org/-meter/Test ecording!"#

.ote that recording is more powerful with a Ja%a /.

Basic Instructions
". 0o to JMETER_HOME/bin and start JMeter with jmeterw.cmd on 1indows and jmeter on 2inux/3nix !. Select 4Test Plan5 on the tree 6. ight clic& on the 4Test Plan5 and add a new thread group, Add > Threads (Users) > Thread Gr !"

7. Select the Thread 0roup 8. ight clic& 49dd :; <onfig (lement :; HTTP e=uest )efaults5

"/>

?. @n new HTTP e=uest )efaults element, Ser%er name A enter 4-meter.apache.org5 /. Path A lea%e $lan&

>.

ight clic& on the 4Thread 0roup5 and add a recording controller, 9dd ; 2ogic <ontroller ; ecording <ontroller

B. .ext, select 1or&Cench "#. ight clic& on 1or&Cench and add the recorder, 9dd :; .on:Test (lements :; HTTP'S+ Test Script ecorder

!/>

"". Dn HTTP'S+ Test Script ecorder, clic& the 49dd5 $utton in 43 2 Patterns to @nclude5. This will create a $lan& entryE enter 4.FG.html5.

"!. ight clic& on 4HTTP'S+ Test Script ecorder5 and add a listener, 9dd :; 2istener :; Hiew esults Tree

6/>

"6. eturn to HTTP'S+ Test Script ecorder, and clic& the 4Start5 $utton at the $ottom. This will start the JMeter proxy ser%er which is used to intercept the $rowser re=uests. 9 file called 9pacheJMeterTemporary oot<9.crt will $e generated in -meter/$in folder. @nstall this certificate in your $rowser, if you donIt &now how to do it, read 4 Installing the JMeter CA certificate for HTTPS recording5 in , http,//-meter.apache.org/usermanual/componentJreference.htmlKHTTPL!>S L!BJTestJScriptJ ecorder

Configure our !ro"ser to use the JMeter Pro#


9t this point, JMeterIs proxy is running. For this exercise, we will use @ceweasel/Firefox to %iew some pages on the JMeter we$site. "6. Start @ceweasel/Firefox, $ut do not close JMeter. "7. From the tool $ar, clic& 4(dit :; Preferences5 'or 4Tools ; Preferences5+. This should $ring up the options. "8. Select the 49d%anced5 ta$, and 4.etwor&5 ta$ "?. <lic& 4Settings5 $utton near the $ottom.

7/>

"/. Dn the new pop:up, chec& 4Manual proxy configuration5. The address and port fields should $e ena$led now. ">. 9ddress A enter 4localhost5 or the @P address of your system "B. Port A enter 4>#>#5. !#. <hec& 43se this proxy ser%er for all protocols5

!". <lic& 4D*5 $utton !!. <lic& 4D*5 $utton again. This should return you to the $rowser

Record our na$igation


!6. 1ith your $rowser, in the 49ddress5 $ar at the top, enter
8/>

4http,//-meter.apache.org/index.html5 and hit the 4enter5 &ey. !7. <lic& on a few lin&s on JMeterIs pages. !8. <lose your $rowser and $ring up the JMeter window. (xpand the thread group and there should $e se%eral samplers. 9t this point, the test plan can $e sa%ed as is. @f you forget to add default HTTP e=uest settings, you will ha%e to manually delete the ser%er name, and port.

@n this sample, there arenIt any default re=uest parameters. @f a particular re=uest parameter is re=uired $y all pages, the re=uest defaults is where one would add the entries. !8. Select 4Thread 0roup5 !?. ight clic& 49dd :; 2istener :; Summary eport5 to add an summary listener.

!/.The summary listener will show some $asic statistics.


?/>

!/. Select 4Thread 0roup5 !>. .um$er of Threads A enter 485 !B. amp up Period A do not change 6#. 2oop <ount A enter "##

Start the test


9t this point, we are ready to run our test plan and see what happens. Sa%e the test plan. 1hen youIre ready to run the test, thereIs two ways, ". un :; Start !. <trlA Cefore you start the test, select 4Summary eport5. 9s the test runs, the statistics will change until the test is done. 9t the end of the test, the summary report should loo& li&e this.

//>

1hile the test is running, in the upper right:hand corner, there should $e a green s=uare. 1hen the test is done, the $ox should $e grey.

>/>

S-ar putea să vă placă și