[ptt-users] feature requests etc...

Geoff Meakin geoffm at gamesys.co.uk
Fri Oct 27 08:24:49 PDT 2006


Whilst on the subject of feature requests (someone was),

Frank it would be good if we could alter the jython that gets "recorded" when you use testmaker in record mode.

At the moment a GET is written out as a self.get() and a POST is written out as a self.post() etc., which is of course perfectly reasonable. If these lines that get generated were actually in files rather than within the java code- metadata as it were, then it would be very useful for tweaking the recorder to do a bit more.

As an example, I have rewritten my version of self.get() and self.post() so that they handle all types of HTTP redirects, HTML META redirects, and javascript redirects within the request itself, but i call those routines self.gethtml and self.posthtml instead in agentbase. I have reverse engineered the recorder so that it writes self.gethtml and self.posthtml lines instead just so i dont have to keep search and replacing.

Any of the above code you're welcome to have if you want it, but thats just a thought- I doubt if anybody will be in the same situation as me anyway!

On second thoughts scratch that idea, I doubt if anybody will find it useful except me!

Cheers
-Geoff




-----Original Message-----
From: users-bounces at lists.pushtotest.com on behalf of Kyle Bell
Sent: Fri 27/10/2006 16:14
To: TestMaker users list
Subject: Re: [ptt-users] (no subject)
 
Paul,

I've run into a similar problem saving cookies when attempting to use
and address which is not a fully qualified host name resolvable via a
DNS domain.  In other words, if the host portion of your url were
server1 rather than server1.att.net, the cookie storage protocol would
reject the cookie storage.  Frank kindly pointed this issue out to me in
previous e-mail threads.  I've noticed your url contains an IP address
rather than a host name.  I don't know if this might be your issue, but
it could be.  Does this IP have a host name representation in your
internal DNS system?  This could be observed in a unix environment by
executing the command "nslookup <ipaddr>".

Regards,

-Kyle

On Fri, 2006-10-27 at 10:55 -0400, Paul Cuda wrote:
> 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
> _______________________________________________
> Users mailing list
> Users at lists.pushtotest.com
> http://lists.pushtotest.com/mailman/listinfo/users
> 

_______________________________________________
Users mailing list
Users at lists.pushtotest.com
http://lists.pushtotest.com/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cake.pushtotest.com/pipermail/users/attachments/20061027/c34de4d4/attachment-0001.htm


More information about the Users mailing list