avebertrand | 2 Aug 2004 20:34
Picon
Favicon

RE: Reuse the JSessionID and login - Please help

xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

Message

Have a look to http://grinder.sourceforge.net/g3/script-gallery.html#script-lifecycle

 

And try to put your login script in the __init__ method

 

Regards, Bertrand

 

De : grinder-use-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:grinder-use-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] De la part de BJ Allmon
Envoyé : lundi 2 août 2004 18:53
À : 'List, Grinder'
Objet : [Grinder-use] Reuse the JSessionID and login - Please help

 

How is it possible to reuse the same JSessionID and login for every consectutive run after the first. So that all the different threads don't have to login again for a performance test that has 5 runs. I have code that tells the test to skip the login after the first run but don't know what else to do... Please help.

 

The code I have so far looks like this...

 

<!-- code snippet below of httpscript.py -->

 

from httpscript_tests import *

from net.grinder.script.Grinder import grinder

class TestRunner:

# There's a runsForThread variable for each worker thread. This

# statement specifies a class-wide initial value.

runsForThread = 0

def __call__(self):

self.runsForThread += 1

if self.runsForThread == 1:

      tests[100].GET('http://localhost:8080/dashboard')

      tests[102].GET('http://localhost:8080/dashboard/ui/menu.jsp')

      grinder.sleep(32)

      tests[103].GET('http://localhost:8080/dashboard/admin/loginPage.jsp',

      ( NVPair('jsessionid', 'FED35B6C9F95406F81ED09852B2760B7'), ))

      grinder.sleep(4063)

      tests[104].POST('http://localhost:8080/dashboard/admin/j_security_check',

      ( NVPair('j_username', 'username1'),

       NVPair('j_password', 'password1'), ))

grinder.sleep(32)

tests[105].GET('http://localhost:8080/dashboard/ui/menu.jsp')

 

BJ


Gmane