jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kai Kaisen <kaikai...@googlemail.com>
Subject BSF Sampler - error on executing external app with blanks in path and name
Date Fri, 11 Mar 2011 16:56:23 GMT
Hi guys,
How to use the BSF Sampler with beanshell to execute an external application
which has blanks in its path and name?
I tried something like this:

exec("/Applications/Adobe\ Photoshop\ CS5/Adobe\ Photoshop\
CS5.app/Contents/MacOS/Adobe\ Photoshop\ CS5");

As you can see I am on a MAC. I know, the problems is caused by the blanks
in the path.I tried different ways to 'mark' them but nothing helped.
JMeter always throws an error:

...

2011/03/11 17:44:41 WARN  - jmeter.protocol.java.sampler.BSFSampler: BSF
error org.apache.bsf.BSFException: BeanShell script error: Sourced file:
inline evaluation of: ``exec("Applications/Adobe\ Photoshop\ CS5/Adobe\
Photoshop\ CS5.app/Contents/MacO . . . '' Token Parsing Error: Lexical error
at line 1, column 26.  Encountered: " " (32), after :
"\"Applications/Adobe\\": <at unknown location>

 BSF info: script at line: 0 column: columnNo

at bsh.util.BeanShellBSFEngine.eval(BeanShellBSFEngine.java:199)

at org.apache.jmeter.protocol.java.sampler.BSFSampler.sample(
BSFSampler.java:150)

at org.apache.jmeter.threads.JMeterThread.process_sampler(
JMeterThread.java:381)

at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:274)

at java.lang.Thread.run(Thread.java:680)


2011/03/11 17:44:42 INFO  - jmeter.threads.JMeterThread: Thread finished:
Thread Group 1-1
...

I also tried:
exec("/Applications/Adobe\\ Photoshop\\ CS5/Adobe\\ Photoshop\\
CS5.app/Contents/MacOS/Adobe\\ Photoshop\\ CS5");
exec("/Applications/Adobe Photoshop CS5/Adobe Photoshop
CS5.app/Contents/MacOS/Adobe Photoshop CS5");
exec("'/Applications/Adobe Photoshop CS5/Adobe Photoshop
CS5.app/Contents/MacOS/Adobe Photoshop CS5'");
Nothing helped.
A workaround is to call a script with a 'clean' name and use this to start
the app but...thats not cool.
Any ideas?
Thank you very much!
Kai

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message