Postentee: SnappyBoy | Posted: January 14, 2005, 22:40
I have been testing with LoadRunner recently, and I don't forget to use JMeter to achieve a more complicated scene. Today, some of the small skills I use will explain to the memo.
1
,start up.
I have installed the JMeter 2.02 version on the machine, I always prompt "Error Occurred During Initialization of VM Could Not Reserve Enough for Object Heap", the 128M memory can not get up a small JMeter: What should I do? Modify the startup parameters of JMeter "SET HEAP = -xms256m -xmx256m" "
Set new = -xx: newsing = 128m -xx: maxnewsize = 128m
2
, Below
Jmeter
The script recording is recorded.
(1) Select the Test Plan to click the right mouse button, select Add-> Thread Group in the pop-up menu;
(2) Next, select Workbench Click the right mouse button, select Add-> Non-Test Elements-> HTTP Proxy Server in the pop-up menu;
(3) Target Controller drop-down box in the "HTTP Proxy Server" window Select Test Plan> Thread Group (indicating that the script is generated under this thread group), the Grouping drop-down box Select Put Each Group in A New Controller (indicating that each set of feet To a new group, avoid the generated script mess and cannot organize);
(4) Click Start at the bottom of the window;
(5) Open the browser, set the setup server set to localhot, the port number is 8080 (in the "HTTP Proxy Server" window, set the 8080 port to listen);
(6) Type the URL to record the page to operate on the address. JMeter automatically records the operation recorded into a script, you can see that there are many child nodes under the Thread Group node are the script that recorded by the record;
(7) After the operation is completed, click Stop to stop recording in the JMeter, and then change the browser's proxy setting to the original setting.
3
, Running and recording results setting
(1) After completing the recording of the script, you need to define the settings you need to complete the settings of the Test Plan. First, set the properties of Thread Group (equivalent to virtual user groups), click Thread Group, on the right window. Set Number Of Thread is 5, Ramp-up Period (in Seconds) is 1, and the loop cout option takes place for ForeVER, and enter 2 in the box. The above settings indicate a total of 5 virtual users, run one, iterate 2 times every 1 second.
(2) To view the results of the run, you need to join the listener. Check the Thread Group Click the right mouse to select Listener-> View Results in Table. You can check the execution of each link through this view, including execution time and success, Add AggRegate Report, you can view the largest, minimum peace response time of each Thread Group group through this view. Join View Results Tree, you can view the execution of each link, including the detailed content returned by the request and the server returned via this view. (3) OK, all settings temporarily end, the next load can be run.
4
, Running and results
(1) OK, run and see, because the setup run time is short, then select View Results in Table, then press the Ctrl R button to start the script, you can see the results of each request, you can Click the other two result views to view the run results in real time.
Said so many believers have met this tool, simple, convenient, cross-platform, can use it, it is its biggest a bit (accounting for Java unavoidable, the first scene) . However, my original intention is to talk about using JMeter to query content parameters, I didn't expect that simplicity spent so many levels, then the next section was again described. The general feeling is "cool".
Chinese site:
http://www.bonoy.com/jmeter/
This article is on my other blog, because it is no longer there, so I will stick it again. Here I attach a piece of script I use - set the script of the browser proxy server, the function is to set the proxy server to localhost, the port is 8080, and open a browser instance, and turn off the instance, cancel the settings of the proxy server. Note: This script is running on my machine, if you want to use your own modification, because you are the operation of the registry, please use the friends who are not familiar with, or use other software with similar functions.
'********************************************************** *****************************
'Script Description: Use this script to set the agent to LocalHost: 8080 and automatically cancel the proxy settings after shutting down the browser.
'Creation: WyingQuan At Hotmail Dot COM
'Creating time: 2004-11-24 Wednesday
'********************************************************** *****************************
'Save the current settings
Set reg = wscript.createObject ("wscript.shell")
'Set the browser to use the agent, server name localhost, port number 8080
REG.REGWRITE "HKCU / Software / Microsoft / Windows / CurrentVersion / Internet Settings / Proxyenable", 1, "REG_DWORD"
Reg.Regwrite "HKCU / Software / Microsoft / Windows / CurrentVersion / Internet Settings / Proxyserver", "LocalHost: 8080", "Reg_SZ"
reg.regwrite "HKLM / SYSTEM / ControlSet001 / Hardware Profiles / Current / Software / Microsoft / windows / CurrentVersion / Internet Settings", 1, "REG_DWORD" reg.regwrite "HKLM / SYSTEM / ControlSet001 / Hardware Profiles / 0001 / Software / Microsoft / Windows / CurrentVersion / Internet Settings, 1, "REG_DWORD"
REG.REGWRITE "HKLM / System / CurrentControlset / Hardware Profiles / 0001 / Software / Microsoft / Windows / CurrentVersion / Internet Settings / Proxyenable", 1, "Reg_dword"
Reg.regWrite "HKLM / System / CurrentControlset / Hardware Profiles / Current / Software / Microsoft / Windows / CurrentVersion / Internet Settings / Proxyenable", 1, "REG_DWORD"
'Get the location of the browser execution file
Runme = reg.regread ("HKLM / Software / Microsoft / Windows / CurrentVersion / App Paths / IExplore.exe /")
'Waiting for user to enter the page to open
SURL = INPUTBOX ("Please enter the URL address you want to open or cancel directly in the browser address bar:", "vbs for jmeter", "http: //")
'Open the test page
Set Oexec = Reg.exec (Runme & "& SURL)
'Waiting to close the browser until running the script
Do while oexec.status = 0
WScript.sleep 100
Loop
'Revocation Agent Service Settings
REG.REGWRITE "HKCU / Software / Microsoft / Windows / CurrentVersion / Internet Settings / Proxyenable", Proxyenable, "REG_DWORD"
REG.REGWRITE "HKCU / Software / Microsoft / Windows / CurrentVersion / Internet Settings / Proxyserver", Proxyserver, "Reg_sz"
Reg.Regwrite "HKLM / System / Controlset001 / Hardware Profiles / Current / Software / Microsoft / Windows / CurrentVersion / Internet Settings", 0, "Reg_dword"
Reg.regwrite "HKLM / System / Controlset001 / Hardware Profiles / 0001 / Software / Microsoft / Windows / CurrentVersion / Internet Settings", 0, "REG_DWORD"
reg.regwrite "HKLM / SYSTEM / CurrentControlSet / Hardware Profiles / 0001 / Software / Microsoft / windows / CurrentVersion / Internet Settings / ProxyEnable", 0, "REG_DWORD" reg.regwrite "HKLM / SYSTEM / CurrentControlSet / Hardware Profiles / Current / Software / Microsoft / Windows / CurrentVersion / Internet Settings / Proxyenable ", 0," REG_DWORD "
Set reg = Nothing
MsgBox "OK", "VBS for Jmeter"