my agents can't find their .py modules scripts files

View: New views
14 Messages — Rating Filter:   Alert me  

my agents can't find their .py modules scripts files

by shayne_b :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, I recorded and heavily modified a few scripts to load test my webapp. They run fine when I don't use the console. I fire up the console and an agent, I set the script-to-run, distribute the files.  
My agent is running in:
D:\code\Grinder\client
The .py modules and data files are all in
D:\code\Grinder\client\SW2-file-store\incoming

When the console tells the agent to run, the agent says:
6/17/08 4:46:56 PM (process SW2-0): Error running worker process (ImportError: no module named misc
        File "D:\code\Grinder\client\createNM.py", line 8, in ?)

The agent is looking in the directory it was started in for the .py modules, but the modules are in the file-store subdirectory.   How do I resolve this?  I can't find any other message about this problem so I must have missed some configuration setting or something easy like that.

The workaround I have been using is to copy all the files from D:\code\Grinder\client\SW2-file-store\incoming to D:\code\Grinder\client but I have to run agents on several remote machines and the manual file copy is causing serious issues.

Re: my agents can't find their .py modules scripts files

by Philip Aston-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

shayne_b wrote:

> Hi, I recorded and heavily modified a few scripts to load test my webapp.
> They run fine when I don't use the console. I fire up the console and an
> agent, I set the script-to-run, distribute the files.  
> My agent is running in:
> D:\code\Grinder\client
> The .py modules and data files are all in
> D:\code\Grinder\client\SW2-file-store\incoming
>
> When the console tells the agent to run, the agent says:
> 6/17/08 4:46:56 PM (process SW2-0): Error running worker process
> (ImportError: no module named misc
>         File "D:\code\Grinder\client\createNM.py", line 8, in ?)
>
> The agent is looking in the directory it was started in for the .py modules,
> but the modules are in the file-store subdirectory.   How do I resolve this?
> I can't find any other message about this problem so I must have missed some
> configuration setting or something easy like that.
>  

There are a couple of bugs in 3.0.1 that I've fixed for the next release:

  Relative paths set for grinder.script are now resolved relative to the
  location of the properties file. This fixes two bugs.
  - Bug 1889281 - grinder.script relative path bug. Thanks to Ross
    Nicholson for the report, and the suggested fix.
  - Bug 1875880 - Script validation wrong for properties file in sub
    directory.

I'll make the next release within the next couple of months. In the
interim, I suggest you do the following.

First check whether you are explicitly setting the grinder.script
property. You shouldn't need t when using console distribution, instead
you should "mark the script" in the console. If that doesn't help,  try
adding something like the following to the start of your script:

    import sys
    sys.path.insert(0, "D:\code\Grinder\client\SW2-file-store\incoming")


- Phil

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use

No module named XMLString - 4suite XMLPath

by Balbir.Kaur :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

I am getting XMLstring error from following import stmt

from Ft.Xml import Domlette ......

I have downloaded 4Suite in Python25 directory...it can recognize Ft module
added this Python path in Jython registry file.

any ideas how to resolve it ?


Thanks
-Balbir

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use

Re: No module named XMLString - 4suite XMLPath

by Philip Aston-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Balbir.Kaur@... wrote:

>
> Hi,
>
> I am getting XMLstring error from following import stmt
>
> from Ft.Xml import Domlette ......
>
> I have downloaded 4Suite in Python25 directory...it can recognize Ft
> module
> added this Python path in Jython registry file.
>
> any ideas how to resolve it ?
>
>
> Thanks
> -Balbir

The Grinder is based on Jython. Jython does not support directly running
all Python (aka CPython) modules due to versioning differences and lack
of support for native code. I suspect this is the reason for your problem.

- Phil


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use

HTTP POST Syntax

by Balbir.Kaur :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

Can somebody please explain the difference b/w GET and POST

1. Can we actually send complete XML file with POST ?
2. or do we need to assign the values to all URL parameters & just call HTTP POST command.


Thanks
-Balbir Kaur

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use

Re: No module named XMLString - 4suite XMLPath

by Balbir.Kaur :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Phil,

Till now I could only run pure SAX parser in Grinder....has anybody tried other parser like Xerces & minidom....I always get some module problem
As I am not a java expert .... I need something written for Jython/Python.

Thanks
-Balbir
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use

Re: No module named_md5

by Balbir.Kaur :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

I am trying to import hashlib in my jython script......and getting error msg

No Module named _md5

Here is traceback result

File C:\Python25\Lib\hashlib.py line 60 in _get_built_constructor

File C:\Python25\Lib\hashlib.py Line 133
no module named -md5

my current directory is c:\grinder-3.0.1

If this is standard problem of importing Python modules in Jython (like parsers, XMLstring)....is there a way to use same Hash sha1 functionality in Jython ..may be using Java ?

can someone please share that recipe.

Thanks

-Balbir

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use


Re: HTTP POST Syntax

by Philip Aston-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Balbir.Kaur@... wrote:
>
> Hi,
>
> Can somebody please explain the difference b/w GET and POST
>
> 1. Can we actually send complete XML file with POST ?

Sure, but you have to read the file into a byte array first before using
http://grinder.sourceforge.net/g3/script-javadoc/net/grinder/plugin/http/HTTPRequest.html#POST(java.lang.String,%20byte[])


> 2. or do we need to assign the values to all URL parameters & just
> call HTTP POST command.
>


- Phil


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use

Re: my agents can't find their .py modules scripts files

by shayne_b :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Philip Aston-2 wrote:
....
First check whether you are explicitly setting the grinder.script
property. You shouldn't need t when using console distribution, instead
you should "mark the script" in the console. If that doesn't help,  try
adding something like the following to the start of your script:

    import sys
    sys.path.insert(0, "D:\code\Grinder\client\SW2-file-store\incoming")


- Phil
Thanks for the quick reply!  I got it working using sys.path.import as you suggested but I had to import the .\current dir instead of .\incoming.

Re: my agents can't find their .py modules scripts files

by shayne_b :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I got it to work once.  Now it doesn't seem to think there is anything to do when I click the run button on the console. I can copy the script files out of the ./incoming directory until the next release.

6/23/08 10:06:54 AM (agent): received a start message
6/23/08 10:06:54 AM (agent): waiting for console signal


shayne_b wrote:
Philip Aston-2 wrote:
....
First check whether you are explicitly setting the grinder.script
property. You shouldn't need t when using console distribution, instead
you should "mark the script" in the console. If that doesn't help,  try
adding something like the following to the start of your script:

    import sys
    sys.path.insert(0, "D:\code\Grinder\client\SW2-file-store\incoming")


- Phil
Thanks for the quick reply!  I got it working using sys.path.import as you suggested but I had to import the .\current dir instead of .\incoming.

Re: No module named XMLString - 4suite XMLPath

by Philip Aston-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Balbir.Kaur@... wrote:

>
> Phil,
>
> Till now I could only run pure SAX parser in Grinder....has anybody
> tried other parser like Xerces & minidom....I always get some module
> problem
> As I am not a java expert .... I need something written for
> Jython/Python.
>
> Thanks
> -Balbir

No idea, sorry. Perhaps ask on the Jython lists.

Unfortunately for you, Java is always the reliable fall back for doing
something in Jython.

- Phil

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use

Re: No module named_md5

by Philip Aston-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Balbir.Kaur@... wrote:

> I am trying to import hashlib in my jython script......and getting
> error msg
>
> No Module named _md5
>
> Here is traceback result
>
> File C:\Python25\Lib\hashlib.py line 60 in _get_built_constructor
>
> File C:\Python25\Lib\hashlib.py Line 133
> no module named -md5
>
> my current directory is c:\grinder-3.0.1
>
> If this is standard problem of importing Python modules in Jython
> (like parsers, XMLstring)....is there a way to use same Hash sha1
> functionality in Jython ..may be using Java ?
>
> can someone please share that recipe.
>

A google search for "hashlib jython" leads to
http://www.linuxmachine.net/2008/06/mini-hashlib-replacement-for-jython-and-python-below-25/,
which might help. If not, there were plenty of other google results :-)

- Phil

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use

Re: No module named XMLString - 4suite XMLPath

by Vishnugupt Chanakya :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey,

I could use minidom ...might be the problem was new version of Python
switched to Python 2.2 & it works :)

-Anu

On Thu, Jun 26, 2008 at 8:33 PM, Philip Aston <philipa@...> wrote:

> Balbir.Kaur@... wrote:
>>
>> Phil,
>>
>> Till now I could only run pure SAX parser in Grinder....has anybody
>> tried other parser like Xerces & minidom....I always get some module
>> problem
>> As I am not a java expert .... I need something written for
>> Jython/Python.
>>
>> Thanks
>> -Balbir
>
> No idea, sorry. Perhaps ask on the Jython lists.
>
> Unfortunately for you, Java is always the reliable fall back for doing
> something in Jython.
>
> - Phil
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> grinder-use mailing list
> grinder-use@...
> https://lists.sourceforge.net/lists/listinfo/grinder-use
>

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use

Re: No module named_md5

by Vishnugupt Chanakya :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

With Python2.2, importing sha1 works :)

-Anu

On Thu, Jun 26, 2008 at 8:38 PM, Philip Aston <philipa@...> wrote:

> Balbir.Kaur@... wrote:
>> I am trying to import hashlib in my jython script......and getting
>> error msg
>>
>> No Module named _md5
>>
>> Here is traceback result
>>
>> File C:\Python25\Lib\hashlib.py line 60 in _get_built_constructor
>>
>> File C:\Python25\Lib\hashlib.py Line 133
>> no module named -md5
>>
>> my current directory is c:\grinder-3.0.1
>>
>> If this is standard problem of importing Python modules in Jython
>> (like parsers, XMLstring)....is there a way to use same Hash sha1
>> functionality in Jython ..may be using Java ?
>>
>> can someone please share that recipe.
>>
>
> A google search for "hashlib jython" leads to
> http://www.linuxmachine.net/2008/06/mini-hashlib-replacement-for-jython-and-python-below-25/,
> which might help. If not, there were plenty of other google results :-)
>
> - Phil
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> grinder-use mailing list
> grinder-use@...
> https://lists.sourceforge.net/lists/listinfo/grinder-use
>

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use
LightInTheBox - Buy quality products at wholesale price