Archives

Meta

There are generally three kinds of popup-1. Alert box 2. Confirm 3. Prompt. These are Client side scripts/programs generated in the webpage. Since Jmeter is build to load test Servers it can’t record these popups generated during recording a site with Jmeter.

1. JMeter is not a browser: JMeter is not a browser. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it’s possible to view the response as HTML etc, but the timings are not included in any samples, and only one sample in one thread is ever viewed at a time).

2. The Proxy Server can only record HTTP traffic (any requests to server)

3. Does JMeter process dynamic pages (e.g. Javascript and applets)

JMeter does not process Javascript or applets embedded in HTML pages. JMeter can download the relevant resources (some embedded resources are downloaded automatically if the correct options are set), but it does not process the HTML and execute any Javascript functions.

If the page uses Javascript to build up a URL or submit a form, you can use the Proxy Recording facility to create the necessary sampler. If this is not possible, then manual inspection of the code may be needed to determine what the Javascript is doing.

I have tried verifying this with two methods. In first method I recorded the pop-ups in BADBOY tool and tried to export it to Jmeter. Secondly tried it with Jmeter itself.

1. ‘Apache-ant’ is the Pre-requisite for generating the report from the jmx file. Apache Ant is a Java-based build tool.
2. Ant-jmeter.jar

Steps:

1. Create a new variable JAVA_HOME in the environment variable and set the path for the jdk.
2. You can find the Environment variable by right clicking on the computer Icon then properties-> Advance-> environment variable. Then click on the new and give the variable name as well as path also.
3. Likewise create another variable ANT_HOME and set the path for the Apache-ant.
4. Create another variable PATH and set the path for apache-ant up to bin folder as shown in the fig. bellow.

5. Place the ant-jmeter.jar file in side ‘Extras’ folder. Which is located in the path jakarta-jmeter-2.3.2->extras
6. Navigate to the ‘build.xml’ folder of the jmeter which is located in the path jakarta-jmeter-2.3.2->extras->build.xml.
7. Set the classpathref = “d:/jakarta-jmeter-2.3.2/extras/ant-jmeter.jar “
8. Set jmeterhome=”D:/jakarta-jmeter-2.3.2″
9. Set style=”D:/jakarta-jmeter-2.3.2/jmeter-results-detail-report${style_version}.xsl” and save it.
10. Now copy your jmx file and the build.xml file put it in a folder where ever you want to generate the report.
11. Open your command prompt and navigate to the folder where your jmx and build file is located.
12. To run a test and create the output report:
Type the command “ant -Dtest=script”(for eg. I have my test.jms file and the command is ant-Dtest=test)
It will generate an Html file. This can be open in the browser as shown in the fig. bellow.

13. To run a test only:
Type the command “ant -Dtest=script run”
14. To run report on existing test output
Type the command “ant -Dtest=script report”

The Thread Group tells JMeter the number of threads you want. Always use 1, since we are using JMeter as a monitor. This is very important for those not familiar with server monitors. As a general rule, using multiple threads for a single server is bad and can create significant stress.

Change the loop count to forever (or some large number) so that enough samples are generated.

2. Add the HTTP Authorization Manager to the Thread Group element (Add –> Config element –> HTTP Authorization Manager). Enter the username and password for your webserver. Important note: the monitor only works with Tomcat5 build 5.0.19 and newer.

1. leave the base URL blank

2. enter the username

3. enter the password

3. Add the HTTP Request to the Thread Group element (Add –> Sampler –> HTTP Request). Then, select the HTTP Request element in the tree and edit the following properties):

1. Change the Name field to “Server Status”.

2. Enter the IP address or Hostname

3. Enter the port number

4. Set the Path field to “/manager/status” if you’re using Tomcat.

5. Add a request parameter named “XML” in uppercase. Give it a value of “true” in lowercase.

6. Check “Use as Monitor” at the bottom of the sampler

4. Add a Constant timer to this thread group (Add –> Timer –> Constant Timer). Enter 5000 milliseconds in the “Thread Delay” box. In general, using intervals shorter than 5 seconds will add stress to your server. Find out what is an acceptable interval before you deploy the monitor in your production environment.

5. Add the Monitor Results Listener by selecting the test plan element (Add –> Listener — > Monitor Results). There are two tabs in the monitor results listener. The first is the “Health”, which displays the status of the last sample the monitor received. The second tab is “Performance”, which shows a historical view of the server’s performance.

6. Run the test and see the result in view listener tree.

The free memory and total memory is in response data for that sample.

Note: If you run out of memory

Negative-effect of Jmeter is they consume a lot of memory. If your JVM is running out of heap memory, you need to edit your Jmeter.bat and increase the heap memory size by editing the following line:

>> HEAP=”-Xms256m -Xmx1024m”

Change the jmeter.bat HEAP=-Xms1024m -Xmx1024m

If you have a system RAM of 2GB then edit jmeter.bat to increase heap memory size “Xms1536m-xmx1536m”.