1

I am using the script to run grinder but when i run its throwing me this exception.Could any one please let me know whats going wrong? why is it not importing random . Thank you

Error running worker process (NameError: PendingDeprecationWarning 
    File "C:\jython2.5.2\Lib\warnings.py", line 265, in ? 
    File "C:\jython2.5.2\jython\Lib\random.py", line 41, in ? 
    File "C:\webservice\testRandomise.py", line 4, in ?

I am running the grinder through console and agent

my Enviroment //setGrinderEnv.cmd

set GRINDERPATH=C:\\grinder-3.10
set HELLOWORLDIMPL=C:\src\main\java\com\webservice
set GRINDERPROPERTIES=C:\grinder-3.10\examples\grinder.properties
set CLASSPATH=%GRINDERPATH%\lib\grinder.jar;%GRINDERPATH%\lib\m-0.0.1-SNAPSHOT.jar;%CLASSPATH%
PATH=%JAVA_HOME%\bin;%PATH%

//startAgent.cmd

call C:\grinder-3.10\setGrinderEnv.cmd
echo %CLASSPATH%
java -cp %CLASSPATH% net.grinder.Grinder %GRINDERPROPERTIES%

//startConsole.cmd

call C:\grinder-3.10\setGrinderEnv.cmd
java -cp %CLASSPATH% net.grinder.Console

I am running the following script

#
# testRandomise.py
#
import random
import string

class TestRandomise:
def __init__(self, filename):
self._users = []
infile = open(filename, "r")

for line in infile.readlines():
  self._users.append(string.split((line),','))
infile.close()

  def getUserInfo(self):
"Pick a random (user) from the list."
return random.choice(self._users)

 from testRandomise import TestRandomise
 tre = TestRandomise("users.txt")

 class TestRunner:
 def __call__(self):
    # Get user for this run.
    (user) = tre.getUserInfo()
Thomas K
  • 39,200
  • 7
  • 84
  • 86
srp
  • 521
  • 11
  • 22
  • Have you tried Google? Searching for `pendingdeprecationwarning jython` gives this as the 2nd hit: http://old.nabble.com/Using-python-libraries-gives-NameError%3A-PendingDeprecationWarning-td29849599.html – Duncan Sep 06 '12 at 12:32
  • Hi,Thank you for your repsonse. I have already tried that but it didn't work for me , so i found another answer now , if i use jython 2.2.1 instead of 2.5.2 its working fine. If I am not wrong i think it is the compatible problem with the grinder 3.10. – srp Sep 06 '12 at 12:52
  • The grinder web page [had a few things to say](http://grinder.sourceforge.net/g3/jython.html#jython-2.5) when using Jython 2.5. Namely, you have to remove or rename the jython jar that comes with grinder (see the "Known Issues" section). It also mentions that the agents require Java 6. – John Szakmeister Sep 06 '12 at 14:18

0 Answers0