Developer Forums | About Us | Site Map
Search  
HOME > TUTORIALS > SERVER SIDE CODING > PYTHON TUTORIALS > WEB APPLICATION TESTING WITH PUFFIN: PART 1


Sponsors





Useful Lists

Web Host
site hosted by netplex

Online Manuals

Web application testing with Puffin: Part 1
By Keyton Weissinger - 2004-05-26 Page:  1 2 3 4 5 6 7 8 9

Test actions

We now have the Puffin framework configured to the demo environment (or your own if you have been altering these statements for your own Web application). Now it's time to configure the possible test actions that we will use in our test plans. But first, let's review what a test action is. A test action is the smallest executable element in a test plan. It may or may not involve a call to your Web application (they usually do). They can represent calls to the database or simply a step in a test plan in which you process some data at a key point in the test plan's execution. We will see examples of non-server call test actions in the next article. In this article, we will stick to those test actions that involve a call to your Web application.

Let's take a brief detour and discuss the demo application that comes with Puffin. The Puffin Palace is a relatively simple Perl CGI application in which you "log in," select a type of item from a list of categories, then select some number of items for your shopping cart, and finally check out and see the total cost. Though simple, we can use it to drive Puffin through its paces.

We'll start by creating a test action that represents the application's login. This is a simple, non-secure "login" in name only. Basically, a user would click a link, and the app would generate a session identifier and then incorporate it into all links on the first page (the list of product categories). Here is the Puffin config file entry for the login message:



<testActions>

   <testAction name='login'>
      <path>/puffindemoapp/start.cgi</path>
   </testAction>
</testActions>

So this test action represents a user's clicking on some link that calls the start.cgi page in the Puffin demo application:


   http://localhost/puffindemoapp/start.cgi

When this page of the demo application is called, the following HTML is returned:


<html>
<body>
<center>
MENU
<p/>
<a href="itemList.cgi?session_id=3201020311352&list=Pets"

>Pets</a><br/>

<a href="itemList.cgi?session_id=3201020311352&list=Books"
>Books</a><br/>
<a href="itemList.cgi?session_id=3201020311352&list=Gear"
>Gear</a><br/>

<a href="itemList.cgi?session_id=3201020311352&list=Posters"
>Posters</a><br/>

<p/>
<a href="showCart.cgi?session_id=3201020311352">View Cart</a>
<br/>
<a href="logout.cgi?session_id=3201020311352">Log out</a>

</center>
</body>
</html>

The demo application randomly generates the session_id parameter on the query string for the itemList.cgi call. This session id is then sent in all subsequent calls to identify the user. In the background, the demo app is creating a unique cart file, etc. The details are not relevant other than the fact that they are meant to mimic the actual login process for some Web applications. We need to get that session id, so that Puffin can send it if any other test actions are called after this one in a test plan.



View Web application testing with Puffin: Part 1 Discussion

Page:  1 2 3 4 5 6 7 8 9 Next Page: Our first output token

First published by IBM developerWorks


Copyright 2004-2017 GrindingGears.com. All rights reserved.
Article copyright and all rights retained by the author.