Grinder - Authentication not working for me
Ravi Kumar Maddi <[email protected]> Tue, 22 Jul 2014 16:43:07 +0530
| Newsgroups | gmane.comp.java.grinder.user |
|---|---|
| Message-ID | <CAP3RjavnYzb1m=y-0fZCmG58fnteSPzNaLeCph+cyU1HMw4GwA@mail.gmail.com> |
Hi ,
I am new to Grinder, I am trying to write login test case in Jython. I am
just using sample templates provided by Grinder. I am getting errors.
*Please need help, what I am doing wrong*
*Same url, username and password I am able to login in browser.*
*I tried IP address and port instead of mycomapny.com
<http://mycomapny.com> also*
My Code is
*auth.properties*
grinder.script = auth.py
grinder.runs = 10
grinder.useConsole = false
grinder.logDirectory = log
*auth.py*
from net.grinder.script.Grinder import grinder
from net.grinder.script import Test
from net.grinder.plugin.http import HTTPRequest
from net.grinder.plugin.http import HTTPPluginControl
from HTTPClient import AuthorizationInfo
# Enable HTTPClient's authorisation module.
HTTPPluginControl.getConnectionDefaults().useAuthorizationModule = 1
test1 = Test(1, "Request resource")
request1 = HTTPRequest()
test1.record(request1)
class TestRunner:
def __call__(self):
threadContextObject = HTTPPluginControl.getThreadHTTPClientContext()
# Set the authorisation details for this worker thread.
AuthorizationInfo.addDigestAuthorization("myapp.com", 80, "My
User", "myuser1", "mypassword", threadContextObject)
result = request1.GET('http://myapp.com/page1')
I am running as:
*java -cp C:\grinder\lib\grinder.jar net.grinder.Grinder src\auth.properties*
*The output:*
2014-07-22 15:17:23,878 INFO -0 : registered plug-in
net.grinder.plugin.http.HTTPPlugin
2014-07-22 15:17:23,947 INFO -0 : running "src\auth.py" using Jython
2.5.3 (2.5:c56500f08d34+, Aug 13 2012, 14:54:35)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)]
2014-07-22 15:17:23,993 INFO -0 thread-0: starting, will do 10 runs
2014-07-22 15:17:23,994 INFO -0 : start time is 1406022443994 ms since Epoch
2014-07-22 15:17:24,337 INFO -0 thread-0 [ run-0, test-1 ]:
http://myapp.com/page1 -> 403 Forbidden, 18680 bytes
2014-07-22 15:17:24,572 INFO -0 thread-0 [ run-1, test-1 ]:
http://myapp.com/page1 -> 403 Forbidden, 18680 bytes
2014-07-22 15:17:24,801 INFO -0 thread-0 [ run-2, test-1 ]:
http://myapp.com/page1 -> 403 Forbidden, 18680 bytes
2014-07-22 15:17:25,030 INFO -0 thread-0 [ run-3, test-1 ]:
http://myapp.com/page1 -> 403 Forbidden, 18680 bytes
2014-07-22 15:17:25,308 INFO -0 thread-0 [ run-4, test-1 ]:
http://myapp.com/page1 -> 403 Forbidden, 18680 bytes
2014-07-22 15:17:25,576 INFO -0 thread-0 [ run-5, test-1 ]:
http://myapp.com/page1 -> 403 Forbidden, 18680 bytes
2014-07-22 15:17:25,804 INFO -0 thread-0 [ run-6, test-1 ]:
http://myapp.com/page1 -> 403 Forbidden, 18680 bytes
2014-07-22 15:17:26,033 INFO -0 thread-0 [ run-7, test-1 ]:
http://myapp.com/page1 -> 403 Forbidden, 18680 bytes
2014-07-22 15:17:26,267 INFO -0 thread-0 [ run-8, test-1 ]:
http://myapp.com/page1 -> 403 Forbidden, 18680 bytes
2014-07-22 15:17:26,494 INFO -0 thread-0 [ run-9, test-1 ]:
http://myapp.com/page1 -> 403 Forbidden, 18680 bytes
2014-07-22 15:17:26,495 INFO -0 thread-0: finished 10 runs
2014-07-22 15:17:26,497 INFO -0 : elapsed time is 2503 ms
2014-07-22 15:17:26,498 INFO -0 : Final statistics for this process:
2014-07-22 15:17:26,523 INFO -0 :
TestsErrorsMean TestTest TimeTPS Mean Response Response Mean time to
Mean time to Mean time to
Time (ms)Standard response bytes pererrorsresolve host establishfirst byte
Deviation lengthsecond connection
(ms)
Test 1100247.4034.604.00 18680.00 74630.44 100.10 3.20 230.20"Request resource"
Totals100247.4034.604.00 18680.00 74630.44 100.10 3.20 230.20
Tests resulting in error only contribute to the Errors column.
Statistics for individual tests can be found in the data file, including
(possibly incomplete) statistics for erroneous tests. Composite tests
are marked with () and not included in the totals.
Thanks and regards,
Ravikumar Maddi,
[email protected],
+ 91 - 8884638999
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
grinder-use mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/grinder-use