[ptt-users] (no subject)
Paul Cuda
pcuda at cellularspecialties.com
Fri Oct 27 07:55:25 PDT 2006
I believe I made all the changes for detailed logging as required. I
have provided a listing below.
However, when I run the program, it should have six steps but as you can
see it stops execution at step three because a of "Illegal Argument to
SaveCookies...". Where does this argument exist? I have seen the
program run thru all six steps early on, perhaps its time to use the
wizard to craft a new one.
A basic question that has been bugging me is:
The web page is built so that and key is exchanged and used throughout
the session. Does TestMaker take this into consideration or does it
attempt to use the key over and over again?
Paul Cuda
'''
Agent name: SunCom102556142
Created on: October 26 2006 AD 12:44 PM
Created by: TestMaker New Agent Wizard Recorder
Note:
Turn this functional test into a scalability and load
test using XSTest found in testmaker_home/XSTest
Turn this functional test into a Quality of Service monitor
using PushToTest Service Monitor System (SMS) found at
http://www.pushtotest.com/Services/slmsolution.html
For details on TestMaker see http://www.pushtotest.com
'''
from com.pushtotest.tool.protocolhandler import ProtocolHandler,
HTTPProtocol
from com.pushtotest.tool.response import Response
import junit
from java.util import Date
import sys, re, time
from java.lang import Exception
from com.pushtotest.tool.util import URLCodec
# Base class of functions that support this test agent
# find this in testmaker_home/lib/agentbase.py
import agentbase
reload(agentbase)
class SunCom102556142( agentbase.agentbase, junit.framework.TestCase ):
'''
Base class implements abstract methods need by recorded test agent
script.
'''
def __init__( self, debuglevel = 3, logto="console",
follow_redirects=0, \
successcodes="20.|300|301|302|303|304|307|401|403|408|41.", \
logpath="log.txt", sleeptime_min=0, sleeptime_max=0,
imagesleeptime=0, \
loadimgtags = "1", imagecache = "1", agentname="test", openlog=1 ):
''' Initialize this test '''
junit.framework.TestCase.__init__(self, agentname)
# Call the agentbase superclass's init method
agentbase.agentbase.__init__( self, debuglevel, logto,
follow_redirects, \
successcodes, logpath, sleeptime_min, sleeptime_max,
imagesleeptime, \
loadimgtags, imagecache, agentname, openlog )
def setUp( self ):
''' Add any needed set-up code here. '''
self.log( 3, "test: setUp" )
self.config()
def runTest( self ):
''' Run the test '''
self.log( 3, "test: runTest" )
self.get( '''http://10.25.56.142/login''')
self.params = [ [ '''a''', '''default''' ],[ '''b''', '''user'''
],[ '''c''', '''Submit''' ],[ '''q''', '''AAAAAAAA''' ] ]
self.get( '''http://10.25.56.142/status.htm''', self.params)
self.params = [ [ '''a''', '''BDA #1 (A PCS) Status''' ],[
'''b''', '''Submit''' ],[ '''q''', '''ADNMLOBD''' ] ]
self.get( '''http://10.25.56.142/summout.htm''', self.params)
self.params = [ [ '''a''', '''Refresh''' ],[ '''b''',
'''Submit''' ],[ '''n''', '''1''' ],[ '''q''', '''ADNMLOBD''' ] ]
self.get( '''http://10.25.56.142/statout.htm''', self.params)
self.params = [ [ '''a''', '''Home''' ],[ '''b''', '''Submit'''
],[ '''n''', '''1''' ],[ '''q''', '''ADNMLOBD''' ] ]
self.get( '''http://10.25.56.142/statout.htm''', self.params)
self.params = [ [ '''a''', '''Logout''' ],[ '''b''',
'''Submit''' ],[ '''q''', '''ADNMLOBD''' ] ]
self.get( '''http://10.25.56.142/summout.htm''', self.params)
# ^^^ Insert new recordings here. (Do not remove this line.)
def tearDown( self ):
''' Add any needed code to end the test here. '''
self.log( 3, "test: tearDown" )
'''
Convenience main method for running this test by itself
otherwise, plug this into XSTest to turn it into a scalability
and load test, and the Service Monitor System (SMS) for
a Quality of Service (QOS) monitor.
'''
if __name__ == 'main':
print '======================================================='
print 'SunCom102556142: Functional test of a Web application '
print '======================================================='
print 'Test created by TestMaker from http://www.pushtotest.com'
print
print
'''
The test class takes the following parameters. See
testmaker_home/lib/agentbase.py
for implementations of these options.
log level = 0- no logging, 1- informational messages, 2- detailed
messages, 3- Everything
log destination = console - to the screen, file - to a file,
response - to the log file in xml form with the
host response,
database - to a JDBC datasource
follow_redirects = 0 - do not follow HTTP 302 response codes, 1 -
follow them automatically
successcodes = Regular Expression (regex) defining HTTP success
response codes
logpath = path and file name to store log file
sleeptime_min = minimum amount of time in seconds to sleep between
requests to the host
sleeptime_max = maximum amount of time to sleep between requests to
the host
imagesleeptime = time in seconds to sleep between requests for <img>
tag references
loadimgtags = 1 - load <img> tag references, 0 - skip them
imagecache = 1 - emulate a browser cache of <img> tag references, 0
- load all <img> tags
logfirst = 1 - add <testmaker> element to head new log files, 0 -
ignore
The settings below were found in the Advanced Options panel of the
Recorder.
'''
test = SunCom102556142( 1, 'console file ', 0,
'20.|300|301|302|303|304|307|401|403|408|41.', 'log.xml', 5, 10, 2, 1,
1, 'SunCom102556142', 1 )
test.setUp()
test.runTest()
test.tearDown()
test.closelog()
print "done"
=================================================
SunCom102556142: Functional test of a Web application
=======================================================
Test created by TestMaker from http://www.pushtotest.com
SunCom102556142: Initialize
Request step: 1, http://10.25.56.142/login
Parsing images
Request step: 2, http://10.25.56.142/status.htm
Parsing images
Request step: 3, http://10.25.56.142/summout.htm
------------------------------
Agent stopped.
------------------------------
Agent error:
Traceback (innermost last):
File "<string>", line 121, in ?
File "<string>", line 64, in runTest
File "I:\TestMaker\TestMaker\.\lib\.\agentbase.py", line 178, in get
File "I:\TestMaker\TestMaker\.\lib\.\agentbase.py", line 208, in
connect
com.pushtotest.tool.ToolException: HTTPProtocol problem: Illegal
Argument to SaveCookies. java.lang.IllegalArgumentException: No Headers
at
com.pushtotest.tool.protocolhandler.HTTPProtocol.connect(HTTPProtocol.ja
va:388) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source) at
org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
at org.python.core.PyMethod.__call__(PyMethod.java) at
org.python.core.PyObject.__call__(PyObject.java:270) at
org.python.core.PyInstance.invoke(PyInstance.java) at
agentbase$py.connect$6(I:\TestMaker\TestMaker\.\lib\.\agentbase.py:208)
at
agentbase$py.call_function(I:\TestMaker\TestMaker\.\lib\.\agentbase.py)
at org.python.core.PyTableCode.call(PyTableCode.java) at
org.python.core.PyTableCode.call(PyTableCode.java) at
org.python.core.PyFunction.__call__(PyFunction.java) at
org.python.core.PyInstance.invoke(PyInstance.java) at
agentbase$py.get$4(I:\TestMaker\TestMaker\.\lib\.\agentbase.py:178)
at
agentbase$py.call_function(I:\TestMaker\TestMaker\.\lib\.\agentbase.py)
at org.python.core.PyTableCode.call(PyTableCode.java) at
org.python.core.PyTableCode.call(PyTableCode.java) at
org.python.core.PyFunction.__call__(PyFunction.java) at
org.python.core.PyInstance.invoke(PyInstance.java) at
org.python.pycode._pyx2.runTest$4(<string>:64) at
org.python.pycode._pyx2.call_function(<string>) at
org.python.core.PyTableCode.call(PyTableCode.java) at
org.python.core.PyTableCode.call(PyTableCode.java) at
org.python.core.PyFunction.__call__(PyFunction.java) at
org.python.core.PyInstance.invoke(PyInstance.java) at
org.python.pycode._pyx2.f$0(<string>:121) at
org.python.pycode._pyx2.call_function(<string>) at
org.python.core.PyTableCode.call(PyTableCode.java) at
org.python.core.PyCode.call(PyCode.java) at
org.python.core.Py.runCode(Py.java) at
org.python.core.Py.exec(Py.java) at
org.python.util.PythonInterpreter.exec(PythonInterpreter.java) at
com.pushtotest.testmaker.gui.AgentRunner.run(Unknown Source)
com.pushtotest.tool.ToolException: com.pushtotest.tool.ToolException:
HTTPProtocol problem: Illegal Argument to SaveCookies.
java.lang.IllegalArgumentException: No Headers
=======================================================
SunCom102556142: Functional test of a Web application
=======================================================
Test created by TestMaker from http://www.pushtotest.com
SunCom102556142: Initialize
Request step: 1, http://10.25.56.142/login
Parsing images
Request step: 2, http://10.25.56.142/status.htm
Parsing images
Request step: 3, http://10.25.56.142/summout.htm
------------------------------
Agent stopped.
------------------------------
Agent error:
Traceback (innermost last):
File "<string>", line 121, in ?
File "<string>", line 64, in runTest
File "I:\TestMaker\TestMaker\.\lib\.\agentbase.py", line 178, in get
File "I:\TestMaker\TestMaker\.\lib\.\agentbase.py", line 208, in
connect
com.pushtotest.tool.ToolException: HTTPProtocol problem: Illegal
Argument to SaveCookies. java.lang.IllegalArgumentException: No Headers
at
com.pushtotest.tool.protocolhandler.HTTPProtocol.connect(HTTPProtocol.ja
va:388) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source) at
org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
at org.python.core.PyMethod.__call__(PyMethod.java) at
org.python.core.PyObject.__call__(PyObject.java:270) at
org.python.core.PyInstance.invoke(PyInstance.java) at
agentbase$py.connect$6(I:\TestMaker\TestMaker\.\lib\.\agentbase.py:208)
at
agentbase$py.call_function(I:\TestMaker\TestMaker\.\lib\.\agentbase.py)
at org.python.core.PyTableCode.call(PyTableCode.java) at
org.python.core.PyTableCode.call(PyTableCode.java) at
org.python.core.PyFunction.__call__(PyFunction.java) at
org.python.core.PyInstance.invoke(PyInstance.java) at
agentbase$py.get$4(I:\TestMaker\TestMaker\.\lib\.\agentbase.py:178)
at
agentbase$py.call_function(I:\TestMaker\TestMaker\.\lib\.\agentbase.py)
at org.python.core.PyTableCode.call(PyTableCode.java) at
org.python.core.PyTableCode.call(PyTableCode.java) at
org.python.core.PyFunction.__call__(PyFunction.java) at
org.python.core.PyInstance.invoke(PyInstance.java) at
org.python.pycode._pyx5.runTest$4(<string>:64) at
org.python.pycode._pyx5.call_function(<string>) at
org.python.core.PyTableCode.call(PyTableCode.java) at
org.python.core.PyTableCode.call(PyTableCode.java) at
org.python.core.PyFunction.__call__(PyFunction.java) at
org.python.core.PyInstance.invoke(PyInstance.java) at
org.python.pycode._pyx5.f$0(<string>:121) at
org.python.pycode._pyx5.call_function(<string>) at
org.python.core.PyTableCode.call(PyTableCode.java) at
org.python.core.PyCode.call(PyCode.java) at
org.python.core.Py.runCode(Py.java) at
org.python.core.Py.exec(Py.java) at
org.python.util.PythonInterpreter.exec(PythonInterpreter.java) at
com.pushtotest.testmaker.gui.AgentRunner.run(Unknown Source)
com.pushtotest.tool.ToolException: com.pushtotest.tool.ToolException:
HTTPProtocol problem: Illegal Argument to SaveCookies.
java.lang.IllegalArgumentException: No Headers
More information about the Users
mailing list