Member Sign In
Not a member?

A Wired.com user account lets you create, edit and comment on Webmonkey articles. You will also be able to contribute to the Wired How-To Wiki and comment on news stories at Wired.com.


It's fast and free.

Sign in with OpenID
Sign In
Webmonkey is a property of Wired Digital.
processing...
Join Webmonkey

Please send me occasional e-mail updates about new features and special offers from Wired/Webmonkey.
Yes No

Please send occasional e-mail offers from Wired/Webmonkey affiliated web sites and publications, and carefully selected companies.
Yes No

I understand and agree that registration on or use of this site constitutes agreement to Webmonkey's User Agreement and Privacy Policy.
Webmonkey is a property of Wired Digital.
processing...

Retrieve Sign In

Please enter your e-mail address or username below. Your username and password will be sent to the e-mail address you provided us.

or
Webmonkey is a property of Wired Digital.
processing...

Welcome to Webmonkey

A private profile page has been created for you.
As a member of Webmonkey, you can now:
  • edit articles
  • add to the code library
  • design and write a tutorial
  • comment on any Webmonkey article
Close
Webmonkey is a property of Wired Digital.

Sign In Information Sent

An e-mail has been sent to the e-mail address registered in this account.
If you cannot find it in your in-box, please check your bulk or junk folders.
Sign In
Webmonkey is a property of Wired Digital.

Learn Functional Testing Using JMeter Components

/skill level/
/viewed/
0 Times

Contents

Introduction

JMeter is found to be very useful and convenient in support of functional testing. Although JMeter is known more as a performance testing tool, functional testing elements can be integrated within the Test Plan, which was originally designed to support load testing. Many other load-testing tools provide little or none of this feature, restricting themselves to performance-testing purposes. Besides integrating functional-testing elements along with load-testing elements in the Test Plan, you can also create a Test Plan that runs these exclusively. In other words, aside from creating a Load Test Plan, JMeter also allows you to create a Functional Test Plan. This flexibility is certainly resource-efficient for the testing project.

This chapter will give a walkthrough on how to create a Test Plan as we incorporate and/or configure JMeter elements to support functional testing. This chapter assumes that you have successfully gone through Chapter 5, and created a Test Plan for a specific target web server. We will begin the chapter with a quick overview to prepare you with a few expectations about JMeter. Later, we will create a new Test Plan similar to the Test Plan in Chapter 5, only smaller. The Test Plan we will create and run at the end of this chapter will incorporate elements that support functional testing, exclusively. Preparing for Functional Testing

In this regard, I need to highlight that JMeter does not have a built-in browser, unlike many functional-test tools. It tests on the protocol layer, not the client layer (i.e. JavaScripts, applets, etc.) and it does not render the page for viewing. Although, by default that embedded resources can be downloaded, rendering these in the Listener | View Results Tree may not yield a 100% browser-like rendering. In fact, it may not be able to render large HTML files at all. This makes it difficult to test the GUI of an application under testing.

However, to compensate for these shortcomings, JMeter allows the tester to create assertions based on the tags and text of the page as the HTML file is received by the client. With some knowledge of HTML tags, you can test and verify any elements as you would expect them in the browser.

Unlike for a load-testing Test Plan, it is unnecessary to select a specific workload time to perform a functional test. In fact, the application you want to test may even reside locally, with your own machine acting as the "localhost" server for your web application. For this chapter, we will limit ourselves to selected functional aspects of the page that we seek to verify or assert.

What you'll need

1.jpeg

2.jpeg

3.jpeg

4.jpeg

Steps

o Preparing for Functional Testing o Using JMeter Components

   + Using HTTP Proxy Server to Record Page Requests
         # Configuring the Proxy Server
         # Adding HTTP Request Default
         # Adding HTTP Header Manager
   + Let the Recording Begin...
   + Adding User Defined Variables

o Running the Test o Summary

Alternate methods

For other details visit http://www.packtpub.com/beginning-apache-jmeter/book#indetail

Suggested readings

This chapter provided visual means for you to understand the capabilities of JMeter tools that support functional testing, as we directly wrote and implemented a JMeter script. We have demonstrated building a Test Plan to contain functional validations (or assertions) by incorporating various essential JMeter components, particularly the 'Response Assertion' element and 'Assertion Result' Listener. By using the 'User Defi ned Variable' Confi guration element, we have also parameterized several values in order to give our Test Plan better fl exibility. In addition, we have observed the result of these assertions as we performed a 'live' run of the application under test. An HTTP Request sampler may require to be modifi ed, if there are any changes to the parameter(s) that the sampler sends with each request. Once created, a JMeter Test Plan that contains assertions can then be used and modifi ed in subsequent Regression tests for the application. The next chapter will let us see various ways that a JMeter script can be further confi gured and tweaked so that it supports better portability and testability. Chapter 7 will describe various methods and tools available in JMeter that support more advanced and complex testing requirements.

For more information visit http://www.packtpub.com/beginning-apache-jmeter/book
  • This page was last modified 11:26, 17 November 2009.
Edit this article
Reddit Digg
 
Subscribe now

Special Offer For Webmonkey Users

WIRED magazine:
The first word on how technology is changing our world.

Subscribe for just $10 a year