You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Erez Naim <er...@theneura.com> on 2015/03/25 14:29:19 UTC
JSON
Hi all,
I am trying to manipulate JSON object in my script using postprocessor
Beanshell, as I try to use JSONObject, JSONParser library and JSONArray
library I am getting the following error (I have added the relevant jar
files into jmeter's lib folder):
BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh
method: eval Sourced file: inline evaluation of: ``import
org.json.JSONArray; import org.json.JSONObject; //import org.json.simple
Typed variable declaration : Class: JSONParser not found in namespace
Any idea how to solve it?
Thanks!
Erez Naim | QA Lead |
<http://www.linkedin.com/profile/view?id=34323263>
<http://www.theneura.com/vCards/gilad.vcf>
<http://twitter.com/#!/giladmeiri/>
EL AL 2 Street | Herzliya
mobile (+972) 50 9 555 686 | fax (408) 689.1366 | skype erez.neura
<http://www.theneura.com/> website | <http://www.startupbitz.com/> blog
| <https://twitter.com/intent/user?screen_name=theneura> twitter |
<http://goo.gl/maps/ZRkg5> map
RE: JSON
Posted by Erez Naim <er...@theneura.com>.
Thanks Flavio Cysne , but I am already resolved my issue, yeah I agree that maniplutaing with JS is pretty much better than using Java for this.
Thumbs up Mate! :)
-----Original Message-----
From: Flavio Cysne [mailto:flaviocysne@gmail.com]
Sent: Thursday, March 26, 2015 5:21 PM
To: JMeter Users List
Subject: RE: JSON
Erez Naim, why not use BSF Post-processor and JavaScript as language? You could parse/manipulate JSon using javascript.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org
Re: JSON
Posted by UBIK LOAD PACK Support <su...@ubikloadpack.com>.
Hi,
For performance Javascript is not a good language.
Also JSR223 should be prefered over BSF.
The best combination is JSR223 + GROOVY + Cache Key if you want to do
custom development.
Regards
@ubikloadpack
On Thu, Mar 26, 2015 at 4:20 PM, Flavio Cysne <fl...@gmail.com> wrote:
> Erez Naim, why not use BSF Post-processor and JavaScript as language? You
> could parse/manipulate JSon using javascript.
>
--
Regards
Ubik Load Pack <http://ubikloadpack.com> Team
Follow us on Twitter <http://twitter.com/ubikloadpack>
Cordialement
L'équipe Ubik Load Pack <http://ubikloadpack.com>
Suivez-nous sur Twitter <http://twitter.com/ubikloadpack>
RE: JSON
Posted by Flavio Cysne <fl...@gmail.com>.
Erez Naim, why not use BSF Post-processor and JavaScript as language? You
could parse/manipulate JSon using javascript.
RE: JSON
Posted by Erez Naim <er...@theneura.com>.
Ok solved the problem:
What should be done is the following steps:
1. Place your JAR file and all the dependent JAR files under the /lib folder of JMeter.
2. Add a BeanShell sampler in your thread group to call methods from your Java class, which you want JMeter to execute.
3. go to "Test Plan", browse and add the jar files under "Add directory path or JAR file to classpath" option.
Hope it helps :)
-----Original Message-----
From: Mark Wilkinson [mailto:inyabass@gmail.com]
Sent: Wednesday, March 25, 2015 4:21 PM
To: JMeter Users List
Subject: Re: JSON
And the relevant jar file for the org.json classes is in your Jmeter lib directory? Normally json-libMy Jmeter 2.12 includes json-lib-2.4.jdk15.jar as part of JMeter itself.
On 25 March 2015 at 13:44, Erez Naim <er...@theneura.com> wrote:
> This is what I am importing:
>
> import org.json.JSONArray;
> import javax.json.stream.*;
> import org.json.JSONObject;
>
> -----Original Message-----
> From: Mark Wilkinson [mailto:inyabass@gmail.com]
> Sent: Wednesday, March 25, 2015 3:41 PM
> To: JMeter Users List
> Subject: Re: JSON
>
> Are you doing an
>
> import javax.json.stream.*;
>
> before using the json classes?
>
> Mark W
>
> On 25 March 2015 at 13:29, Erez Naim <er...@theneura.com> wrote:
>
> > Hi all,
> >
> >
> >
> > I am trying to manipulate JSON object in my script using
> > postprocessor Beanshell, as I try to use JSONObject, JSONParser
> > library and JSONArray library I am getting the following error (I
> > have added the relevant jar files into jmeter's lib folder):
> >
> >
> >
> > BeanShell script org.apache.jorphan.util.JMeterException: Error
> > invoking bsh method: eval Sourced file: inline evaluation of:
> > ``import org.json.JSONArray; import org.json.JSONObject; //import
> > org.json.simple Typed variable declaration : Class: JSONParser not
> > found in namespace
> >
> >
> >
> > Any idea how to solve it?
> >
> >
> >
> > Thanks!
> >
> >
> >
> > Erez Naim | QA Lead | [image: LinkedIn]
> > <http://www.linkedin.com/profile/view?id=34323263> [image: vCard]
> > <http://www.theneura.com/vCards/gilad.vcf> [image: Twitter]
> > <http://twitter.com/#!/giladmeiri/>
> >
> > [image: cid:image004.png@01D01E1B.5F153500]
> >
> > EL AL 2 Street | Herzliya
> > mobile (+972) 50 9 555 686 | fax (408) 689.1366 | skype erez.neura
> >
> >
> >
> > website <http://www.theneura.com/> | blog
> > <http://www.startupbitz.com/> | twitter
> > <https://twitter.com/intent/user?screen_name=theneura> | map
> > <http://goo.gl/maps/ZRkg5>
> >
> >
> >
> >
> >
>
>
>
> --
> Mark Wilkinson
> inyabass@gmail.com 07968 398828
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>
--
Mark Wilkinson
inyabass@gmail.com 07968 398828
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org
Re: JSON
Posted by Mark Wilkinson <in...@gmail.com>.
And the relevant jar file for the org.json classes is in your Jmeter lib
directory? Normally json-libMy Jmeter 2.12 includes json-lib-2.4.jdk15.jar
as part of JMeter itself.
On 25 March 2015 at 13:44, Erez Naim <er...@theneura.com> wrote:
> This is what I am importing:
>
> import org.json.JSONArray;
> import javax.json.stream.*;
> import org.json.JSONObject;
>
> -----Original Message-----
> From: Mark Wilkinson [mailto:inyabass@gmail.com]
> Sent: Wednesday, March 25, 2015 3:41 PM
> To: JMeter Users List
> Subject: Re: JSON
>
> Are you doing an
>
> import javax.json.stream.*;
>
> before using the json classes?
>
> Mark W
>
> On 25 March 2015 at 13:29, Erez Naim <er...@theneura.com> wrote:
>
> > Hi all,
> >
> >
> >
> > I am trying to manipulate JSON object in my script using postprocessor
> > Beanshell, as I try to use JSONObject, JSONParser library and
> > JSONArray library I am getting the following error (I have added the
> > relevant jar files into jmeter's lib folder):
> >
> >
> >
> > BeanShell script org.apache.jorphan.util.JMeterException: Error
> > invoking bsh method: eval Sourced file: inline evaluation of: ``import
> > org.json.JSONArray; import org.json.JSONObject; //import
> > org.json.simple Typed variable declaration : Class: JSONParser not
> > found in namespace
> >
> >
> >
> > Any idea how to solve it?
> >
> >
> >
> > Thanks!
> >
> >
> >
> > Erez Naim | QA Lead | [image: LinkedIn]
> > <http://www.linkedin.com/profile/view?id=34323263> [image: vCard]
> > <http://www.theneura.com/vCards/gilad.vcf> [image: Twitter]
> > <http://twitter.com/#!/giladmeiri/>
> >
> > [image: cid:image004.png@01D01E1B.5F153500]
> >
> > EL AL 2 Street | Herzliya
> > mobile (+972) 50 9 555 686 | fax (408) 689.1366 | skype erez.neura
> >
> >
> >
> > website <http://www.theneura.com/> | blog
> > <http://www.startupbitz.com/> | twitter
> > <https://twitter.com/intent/user?screen_name=theneura> | map
> > <http://goo.gl/maps/ZRkg5>
> >
> >
> >
> >
> >
>
>
>
> --
> Mark Wilkinson
> inyabass@gmail.com 07968 398828
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>
--
Mark Wilkinson
inyabass@gmail.com 07968 398828
RE: JSON
Posted by Erez Naim <er...@theneura.com>.
This is what I am importing:
import org.json.JSONArray;
import javax.json.stream.*;
import org.json.JSONObject;
-----Original Message-----
From: Mark Wilkinson [mailto:inyabass@gmail.com]
Sent: Wednesday, March 25, 2015 3:41 PM
To: JMeter Users List
Subject: Re: JSON
Are you doing an
import javax.json.stream.*;
before using the json classes?
Mark W
On 25 March 2015 at 13:29, Erez Naim <er...@theneura.com> wrote:
> Hi all,
>
>
>
> I am trying to manipulate JSON object in my script using postprocessor
> Beanshell, as I try to use JSONObject, JSONParser library and
> JSONArray library I am getting the following error (I have added the
> relevant jar files into jmeter's lib folder):
>
>
>
> BeanShell script org.apache.jorphan.util.JMeterException: Error
> invoking bsh method: eval Sourced file: inline evaluation of: ``import
> org.json.JSONArray; import org.json.JSONObject; //import
> org.json.simple Typed variable declaration : Class: JSONParser not
> found in namespace
>
>
>
> Any idea how to solve it?
>
>
>
> Thanks!
>
>
>
> Erez Naim | QA Lead | [image: LinkedIn]
> <http://www.linkedin.com/profile/view?id=34323263> [image: vCard]
> <http://www.theneura.com/vCards/gilad.vcf> [image: Twitter]
> <http://twitter.com/#!/giladmeiri/>
>
> [image: cid:image004.png@01D01E1B.5F153500]
>
> EL AL 2 Street | Herzliya
> mobile (+972) 50 9 555 686 | fax (408) 689.1366 | skype erez.neura
>
>
>
> website <http://www.theneura.com/> | blog
> <http://www.startupbitz.com/> | twitter
> <https://twitter.com/intent/user?screen_name=theneura> | map
> <http://goo.gl/maps/ZRkg5>
>
>
>
>
>
--
Mark Wilkinson
inyabass@gmail.com 07968 398828
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org
Re: JSON
Posted by Mark Wilkinson <in...@gmail.com>.
Are you doing an
import javax.json.stream.*;
before using the json classes?
Mark W
On 25 March 2015 at 13:29, Erez Naim <er...@theneura.com> wrote:
> Hi all,
>
>
>
> I am trying to manipulate JSON object in my script using postprocessor
> Beanshell, as I try to use JSONObject, JSONParser library and JSONArray
> library I am getting the following error (I have added the relevant jar
> files into jmeter's lib folder):
>
>
>
> BeanShell script org.apache.jorphan.util.JMeterException: Error invoking
> bsh method: eval Sourced file: inline evaluation of: ``import
> org.json.JSONArray; import org.json.JSONObject; //import org.json.simple
> Typed variable declaration : Class: JSONParser not found in namespace
>
>
>
> Any idea how to solve it?
>
>
>
> Thanks!
>
>
>
> Erez Naim | QA Lead | [image: LinkedIn]
> <http://www.linkedin.com/profile/view?id=34323263> [image: vCard]
> <http://www.theneura.com/vCards/gilad.vcf> [image: Twitter]
> <http://twitter.com/#!/giladmeiri/>
>
> [image: cid:image004.png@01D01E1B.5F153500]
>
> EL AL 2 Street | Herzliya
> mobile (+972) 50 9 555 686 | fax (408) 689.1366 | skype erez.neura
>
>
>
> website <http://www.theneura.com/> | blog <http://www.startupbitz.com/>
> | twitter <https://twitter.com/intent/user?screen_name=theneura> | map
> <http://goo.gl/maps/ZRkg5>
>
>
>
>
>
--
Mark Wilkinson
inyabass@gmail.com 07968 398828