testaction (version 0.8.8, 30 April 2002)
index
c:\work\puffin\testaction.py

The test action is the fundamental unit of any puffin test plan. It represents a step in a
larger process. Most often, a test action represents a call to your web application. However,
sometimes, a test action can represent only a specific action in a test plan that, when
executed, produces an output value for later use.
 
Test actions (as are most things) are configured in the puffin config file.
Here is an example test action that involves a server call:
 
      <testAction name='login' stopPlanOnFail='1'>
         <path>/jsp/appLogin.jsp</path>
         <responseAnalyzers useDefaults="1">
            <responseAnalyzer src="puffin" type="ExpressionResponseAnalyzer">
               <param name="expr"><![CDATA[E.C.PTION]]></param>
               <param name="caseSensitive">0</param>
               <param name="re">1</param>
               <param name="foundResult">0</param>
            </responseAnalyzer>
         </responseAnalyzers>
         <input name='userid' type='POST' processor='DICT' sendDefault='0' defaultValue=''>
            <param name='key' eval='0'>USER</param>
         </input>
         <input name='password' type='POST' processor='DICT' sendDefault='0' defaultValue=''>
            <param name='key' eval='0'>PASSWORD</param>
         </input>
         <output key='SECURITY_COOKIE' processor='extractHeader' extractDefault='0' defaultValue=''>
            <param name='headerName' eval='0'>set-cookie</param>
            <param name='headerPrefix' eval='0'>WebLogic</param>
         </output>
      </testAction>
 
As you can see, you have a path (which represents how to call the server app) and a series
of inputs and/or outputs. It also includes a section specifying the response analyzers to 
use with this test action (note you can choose to ALSO use the defaults as well as the
response analyzers configured here, if you choose). The default on whether or not to use
the default response analyzers is TRUE. This results in the test action's response being
analyzed against the default response analyzers and the response analyzers configured 
specifically to the test action.
 
Here is an example test action that does NOT involve a server call:
 
       <testAction name='loginLoad' stopPlanOnFail='0' noSvrCall='1'>
          <path/>
          <output key='USER' processor='getNextLoginInfo' src='custom' extractDefault='0' defaultValue=''>
             <param name='returnVal' eval='0'>USER</param>
          </output>
          <output key='PASSWORD' processor='getNextLoginInfo' src='custom' extractDefault='0' defaultValue=''>
             <param name='returnVal' eval='0'>PASSWORD</param>
          </output>
          <output key='ITEMS_REMAINING' processor='getNextLoginInfo' src='custom' extractDefault='0' defaultValue=''>
             <param name='returnVal' eval='0'>ITEMS_REMAINING</param>
          </output>
       </testAction>
 
Note that other than the noSvrCall attribute on the <testAction> element, there is no
difference between a test action that involves a server call and one that does not.
 
To execute a test action, you must specify it in a test plan. Test plans come in two forms.
For more detail, see the user's guide in /doc folder.
 
All test actions can have one or more input and/or output tokens. (For more information on 
inputs and/or outputs, see the tokenprocessing module.) However, puffin need not process all
inputs or outputs. You can specify that only some subset of the total set of possible inputs
or outputs get processed in the test plan. See the user's guide for more information.

 
Modules
            
extensions
httplib
mx.DateTime.mxDateTime.mxDateTime
puffinlogging
responseanalyzer
sys
urllib
_xmlplus
 
Classes
            
ActionResponse
TestAction
 
class ActionResponse
      An ActionResponse object represents the results of a TestAction object's execution.
 
   Methods defined here:
__init__(self, actionName, responseCode, responseMsg, responseHeaders, rawResponseDoc, startTime, endTime, inputValueTupleList)
Instantiate and initialize an ActionResult object.
 
Keyword Arguments:
actionName -- The name of the executed TestAction.
responseCode -- The HTTP response code returned upon execution of the action.
responseMsg -- The HTTP response message returned upon execution of the action.
responseHeaders -- A list of HTTP response headers returned upon execution of the action.
rawResponseDoc -- The raw response document returned upon execution of the action.
startTime -- The time at which the TestAction's execution began.
endTime -- The time at which the testAction's execution ended.
inputTokensTupleList -- The list of (tokenName, tokenValue) items for the inputs used
    in the execution of this test action.
getActionName(self)
Return the action name.
getEndTime(self)
Return the end time for the test action.
getInputTupleList(self)
Return the input token tuple list for the test action.
getOutputTupleList(self)
Return the output token tuple list for the test action.
getRawResponseDoc(self)
Return the raw result document.
getResponseCode(self)
Return the HTTP response code.
getResponseHeaders(self)
Return the HTTP response headers.
getResponseMsg(self)
Return the HTTP response message.
getStartTime(self)
Return the start time for the test action.
setOutputTupleList(self, outputTokenTupleList)
Set the output token tuple list for the test action.

Data and non-method functions defined here:
__doc__ = "An ActionResponse object represents the results of a TestAction object's execution."
__module__ = 'testaction'
 
class TestAction
      The test action is the fundamental unit of any puffin test plan. It represents a step in a
larger process. Most often, a test action represents a call to your web application. However,
sometimes, a test action can represent only a specific action in a test plan that, when
executed, produces an output value for later use.
 
   Methods defined here:
_TestAction__processInputs = __processInputs(self, currentTokenDictionary, taskItemInputs, inputTokensTupleList)
Go through list of input tokens, generate appropriate values
and return them for appropriate addition to the HTTP request object.
 
Keyword Arguments:
currentTokenDictionary -- The current token dictionary for the executing
    test plan.
taskItemInputs -- The names of the inputs to process for this execution of this
    test action. If this is None, then process them all. This list comes from a
    attribute of the test action in the test plan (NOT from the config file).
inputTokensTupleList -- This is the the tuple list of input tokens. The 
__processInputs method alters it in place (TODO: FIX THIS).
_TestAction__processOutputs = __processOutputs(self, outputList, tokenDictionary, actionResponse, taskItemOutputs)
Go through list of output tokens and replace/generate appropriate values.
 
Keyword Arguments:
tokenDictionary -- The current token dictionary for the currently executing
    test plan.
actionResponse -- An object representing the response sent by the server upon
    the last test action's execution.
taskItemOutputs -- The names of the outputs to process for this execution of this
    test action. If this is None, execute them all. This list comes from a
    attribute of the test action in the test plan (NOT from the config file).
__init__(self, testActionNode, defaultResponseAnalyzerList)
Constructor for a test action.
 
Keyword Arguments:
testActionNode -- The <testAction> node from the puffin config xml file.
defaultResponseAnalyzer -- Used if no response analyzer is specified for this 
    specific test action.
addInputs(self, additionalInputList)
Add a list of inputs to the test action's list of inputs.
This method is required to allow for the addition of auto-inputs.
 
Keyword Arguments:
additionalInputList -- The list of inputs to be added.
addOutputs(self, additionalOutputList)
Add a list of outputs to the test action's list of outputs.
This method is required to allow for the addition of auto-outputs.
 
Keyword Arguments:
additionalOutputList -- The list of outputs to be added.
execute(self, hostString, tokenDictionary, taskItemInputs, taskItemOutputs)
Execute the test action.
 
Keyword Arguments:
hostString -- The full host string for the test server.
tokenDictionary -- The current token dictionary for the test run.
taskItemInputs -- A list of names of inputs to process for this execution 
    of this test action. If taskItemInputs == None, then process all inputs.
taskItemOutputs -- A list of names of outputs to process for this execution
    of this test action. If taskItemOutputs == None, then process all outputs.
getActionName(self)
Return the name of this test action.
getPath(self)
Return the path if there is one.
getStopPlanOnFail(self)
Return whether or not to stop the overall test plan should this test
action fail.
setPath(self, newPath)
Set the path.
 
Keyword Arguments:
newPath -- The new value for the path attribute.

Data and non-method functions defined here:
__doc__ = 'The test action is the fundamental unit of any ...d, produces an output value for later use.\n '
__module__ = 'testaction'
 
Functions
            
Date = DateTime(...)
DateTime(year,month=1,day=1,hour=0,minute=0,second=0.0)
 
Returns a DateTime-object reflecting the given date
and time. Seconds can be given as float to indicate
fractions.
DateTime(...)
DateTime(year,month=1,day=1,hour=0,minute=0,second=0.0)
 
Returns a DateTime-object reflecting the given date
and time. Seconds can be given as float to indicate
fractions.
DateTimeDelta(...)
DateTimeDelta(days[,hours=0.0,minutes=0.0,seconds=0.0])
 
Returns a DateTimeDelta-object reflecting the given
day and time delta.
DateTimeDeltaFromDays(...)
DateTimeDeltaFromDays(days)
 
Returns a DateTimeDelta-object reflecting the given time
value given in days (fractions are allowed).
DateTimeDeltaFromSeconds(...)
DateTimeDeltaFromSeconds(seconds)
 
Returns a DateTimeDelta-object reflecting the given time
value.
DateTimeFromAbsDateTime(...)
DateTimeFromAbsDateTime(absdate[,abstime=0.0])
 
Returns a DateTime-object for the given absolute values.
DateTimeFromAbsDays(...)
DateTimeFromAbsDays(absdays)
 
Returns a DateTime-object reflecting the given time
value (days since the epoch).
DateTimeFromCOMDate(...)
DateTimeFromCOMDate(comdate)
 
Returns a DateTime-object reflecting the given date
and time.
GregorianDate = DateTime(...)
DateTime(year,month=1,day=1,hour=0,minute=0,second=0.0)
 
Returns a DateTime-object reflecting the given date
and time. Seconds can be given as float to indicate
fractions.
GregorianDateTime = DateTime(...)
DateTime(year,month=1,day=1,hour=0,minute=0,second=0.0)
 
Returns a DateTime-object reflecting the given date
and time. Seconds can be given as float to indicate
fractions.
JulianDate = JulianDateTime(...)
JulianDateTime(year,month=1,day=1,hour=0,minute=0,second=0.0)
 
Returns a DateTime-object reflecting the given Julian date
and time. Seconds can be given as float to indicate
fractions.
JulianDateTime(...)
JulianDateTime(year,month=1,day=1,hour=0,minute=0,second=0.0)
 
Returns a DateTime-object reflecting the given Julian date
and time. Seconds can be given as float to indicate
fractions.
Timestamp = DateTime(...)
DateTime(year,month=1,day=1,hour=0,minute=0,second=0.0)
 
Returns a DateTime-object reflecting the given date
and time. Seconds can be given as float to indicate
fractions.
cmp(...)
cmp(value1,value2[,accuracy=0.0])
 
Compares two DateTime[Delta] objects. If accuracy is
given, then equality will result in case the absolute
difference between the two values is less than or equal
to accuracy.
gmt = utc(...)
utc()
 
Returns a DateTime-object reflecting the current UTC time.
now(...)
now()
 
Returns a DateTime-object reflecting the current local time.
setnowapi(...)
setnowapi(fct)
 
Sets the current time API used by now(). This must be
a callable function which returns the current local time in
Unix ticks.
utc(...)
utc()
 
Returns a DateTime-object reflecting the current UTC time.
 
Data
             ARPA = <lazy module 'mx.DateTime.ARPA'>
April = 4
August = 8
December = 12
Epoch = <DateTime object for '0001-01-01 00:00:00.00' at a77ef0>
Feasts = <lazy module 'mx.DateTime.Feasts'>
February = 2
Friday = 4
Gregorian = 'Gregorian'
ISO = <lazy module 'mx.DateTime.ISO'>
January = 1
Julian = 'Julian'
July = 7
June = 6
Locale = <lazy module 'mx.DateTime.Locale'>
March = 3
MaxDateTime = <DateTime object for '5867440-12-31 00:00:00.00' at ad0d58>
MaxDateTimeDelta = <DateTimeDelta object for '2147483647:00:00:00.00' at 7e3d20>
May = 5
MinDateTime = <DateTime object for '-5851455-01-01 00:00:00.00' at a79ef8>
MinDateTimeDelta = <DateTimeDelta object for '-2147483647:00:00:00.00' at ad0cd8>
Monday = 0
Month = {None: 0, 0: None, 1: 'January', 2: 'February', 3: 'March', 4: 'April', 5: 'May', 6: 'June', 7: 'July', 8: 'August', ...}
NIST = <lazy module 'mx.DateTime.NIST'>
November = 11
ODMG = <lazy module 'mx.DateTime.ODMG'>
October = 10
POSIX = 1
Parser = <lazy module 'mx.DateTime.Parser'>
Saturday = 5
September = 9
Sunday = 6
Thursday = 3
Tuesday = 1
Wednesday = 2
Weekday = {0: 'Monday', 1: 'Tuesday', 2: 'Wednesday', 3: 'Thursday', 4: 'Friday', 5: 'Saturday', 6: 'Sunday', 'Friday': 4, 'Monday': 0, 'Saturday': 5, ...}
__author__ = 'Keyton Weissinger '
__date__ = '30 April 2002'
__file__ = '.\\testaction.pyc'
__name__ = 'testaction'
__status__ = 'beta'
__version__ = '0.8.8'
current_myriad = 245
mxDateTimeAPI = <PyCObject object at 0x00B1B598>
oneDay = <DateTimeDelta object for '1:00:00:00.00' at acc948>
oneHour = <DateTimeDelta object for '01:00:00.00' at 774928>
oneMinute = <DateTimeDelta object for '00:01:00.00' at ac0140>
oneSecond = <DateTimeDelta object for '00:00:01.00' at ac03b8>
oneWeek = <DateTimeDelta object for '7:00:00:00.00' at ad5ea0>
 
Author
             Keyton Weissinger <keyton@weissinger.org>