[ptt-users] HTTP params in agentbase script
Mark.Lutton at thomson.com
Mark.Lutton at thomson.com
Wed Nov 29 17:19:52 PST 2006
Hello!
I'm just beginning to use TestMaker and I have a problem that I don't understand. (TestMaker 4.4; Tomcat 5.0.28 on the server side.)
I used the Recorder to create a script. This has a number of self.get() statements in it.
Here is part of the script:
self.params = [ [ '''userName''', '''manager''' ], ['''password''', '''manager''' ], [ '''submit''', '''Logon''' ] ]
self.post( '''http://localhost:8080/myApp/logon.do''', self.params)
On the server side I have the application print the parameters from the HTTP request:
Logon: parameter: password=manager
Logon: parameter: submit=Logon
Logon: parameter: userName=manager
My application has a "magic URL" which, if called as the very first request on start up, sets it to a local test mode. So I added the following to the script before any other self.get or self.post:
self.get('''http://localhost:8080/myApp/quickStartFake.do?start=true''')
This is followed by several other get's and then the post as seen above. But now here's what happens in the logon request:
Logon: parameter: password=manager
Logon: parameter: submit=Logon
Logon: parameter: userName=manager
Logon: parameter: start=true
It should still have only the three parameters password, submit and userName. I don't think the problem is on the server side. The parameter is not cached, and it's not being put into the request by the application. I can't force this to happen from the browser.
Here is what I see in the Tomcat log. In the first case (no quickStartFake):
"POST /myApp/logon.do HTTP/1.1"
"GET /myApp/managerConsole.do HTTP/1.1" etc.
In the second case:
"GET /myApp/quickStartFake.do?start=true HTTP/1.1"
"POST /myApp/logon.do?start=true HTTP/1.1"
"GET /myApp/managerConsole.do?start=true HTTP/1.1" etc.
It appears that the query parameter is extracted from the first get and appended to each succeeding get or post. I can't see how this is happening in agentbase.py, or any way to fix this.
Can anyone explain what is happening? Thanks.
Mark Lutton
Business Intelligence Services, a Thomson Business
More information about the Users
mailing list