Re: [Grinder-use] Problem in simulating multiple users script
Distributed load testing framework - Java, Jython, or Clojure scripts.
Brought to you by:
philipa
From: Philip A. <pa...@be...> - 2006-11-30 07:54:45
|
http://grinder.sourceforge.net/faq.html#jython-libraries ________________________________ From: gri...@li... [mailto:gri...@li...] On Behalf Of Vaishali More Sent: 29 November 2006 20:41 To: gri...@li... Subject: [Grinder-use] Problem in simulating multiple users script Hi, I have recorded a script for 1 user but when i am trying to use the existing script in the FAQ of grinder for simulating for different users it is giving error. # # testRandomise.py # import random import string class TestRandomise: def __init__(self, filename): self._users =3D [] infile =3D open(filename, "r") for line in=20 infile.readlines(): self._users.append(string.split((line),',')) infile.close() def getUserInfo(self): "Pick a random (user, password) from the list." return random.choice (self._users) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D #nexttext.py (have past only that script part which i have midified) from net.grinder.script import Test from net.grinder.script.Grinder import grinder from testRandomise import TestRandomise tre =3D TestRandomise("users.txt") from net.grinder.plugin.http import HTTPPluginControl, HTTPRequest from HTTPClient import NVPair connectionDefaults =3D=20 HTTPPluginControl.getConnectionDefaults() httpUtilities =3D HTTPPluginControl.getHTTPUtilities() ........................ class TestRunner: def __call__(self): # Get user for this run. (user, passwd) =3D tre.getUserInfo() ................... def page7(self): """POST login (request 701).""" self.token_hasMsgr =3D \ '1' result =3D request701.POST('/config/login', ( NVPair('.tries', self.token_tries), NVPair('.src', 'ym'), NVPair('.md5', self.token_md5), NVPair('.hash', self.token_hash), NVPair('.js', self.token_js), NVPair('.last', ''), NVPair('promo', ''), NVPair('.intl', 'us'), NVPair('.bypass', ''), NVPair('.partner', ''), NVPair('.u', 'ef15r5p2mrmnr'), NVPair('.v', '0'), NVPair('.challenge', self.token_challenge), NVPair('.yplus', self.token_yplus), NVPair('.emailCode', self.token_emailCode), NVPair('pkg', ''), NVPair('stepid', ''), NVPair('.ev', self.token_ev), NVPair('hasMsgr', self.token_hasMsgr), NVPair('.chkP', self.token_chkP), NVPair('.done', ' http://mail.yahoo.com' <http://mail.yahoo.com%27> ), NVPair('.pd', 'ym_ver%3d0'), NVPair('login', user), NVPair('passwd', passwd), ), ( NVPair('Content-Type', 'application/x-www-form-urlencoded'), )) self.token_rand =3D \ httpUtilities.valueFromBodyURI('.rand') # '4i9b6c16nks4k' return result ..... error : 11/29/06 3:11:30 PM (process abh6471bcd0b4-0): Error running worker process (ImportError: no module named random File "C:\grinder-3.0-beta31\lib\testRandomise.py", line 4, in ? File "nexttest.py", line 6, in ?) can anybody help me why this error is occuring? =20 _______________________________________________________________________ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. |