You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by David Schulberg <Da...@objectconsulting.com.au> on 2007/08/03 08:26:05 UTC

Beanshells

Hi,
 
I have put some simple statements into beanshell scripts but I am always getting errors like
 
In PreProcessor:
16:03:44 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``// set up some vars for substitution on queries int studentId = 100000+Integer.parseInt("${__threadNum}"); '' 

In Listener:
15:46:28 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``print sampleResult();'' : Class: print not found in namespace
 
What I am missing here?
I have downloaded bsh-2.0b4.jar from www.beanshell.org into my lib directory 
 
 
Regards,
David Schulberg

Object Consulting | Senior Consultant
email: david.schulberg@objectconsulting.com.au
----------------------------------------------------------------
consulting | development | training | support
our experience makes the difference 

 


Re: Beanshells

Posted by sebb <se...@gmail.com>.
Unfortunately, that won't work, as the Post-Processors are run before
the Assertions:

http://jakarta.apache.org/jmeter/usermanual/test_plan.html#executionorder

Sorry.

However, you might be able to use a BeanShell Listener instead.

On 10/08/07, sebb <se...@gmail.com> wrote:
> See the Javadoc for SampleResult:
>
> http://jakarta.apache.org/jmeter/api/org/apache/jmeter/samplers/SampleResult.html#getAssertionResults()
>
> The SampleResult object is available in the "prev" variable.
>
> On 10/08/07, David Schulberg <Da...@objectconsulting.com.au> wrote:
> > Hi,
> >
> > Is there a way to grab an assertion result using a Beanshell post-processor?
> >
> > David Schulberg
> >
> > Object Consulting | Senior Consultant
> > email: david.schulberg@objectconsulting.com.au
> > ----------------------------------------------------------------
> > consulting | development | training | support
> > our experience makes the difference
> >
> > ________________________________
> >
> > From: sebb [mailto:sebbaz@gmail.com]
> > Sent: Thu 9/08/2007 9:02 PM
> > To: JMeter Users List
> > Subject: Re: Beanshells
> >
> >
> >
> > On 03/08/07, David Schulberg <Da...@objectconsulting.com.au> wrote:
> > > Hi,
> > >
> > > I have put some simple statements into beanshell scripts but I am always getting errors like
> > >
> > > In PreProcessor:
> > > 16:03:44 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``// set up some vars for substitution on queries int studentId = 100000+Integer.parseInt("${__threadNum}"); ''
> > >
> > > In Listener:
> > > 15:46:28 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``print sampleResult();'' : Class: print not found in namespace
> >
> > The correct syntax is:
> >
> > print(object);
> >
> > Try starting with a very simple script such as:
> >
> > print("test");
> >
> > and work from there.
> >
> > Beanshell uses Java syntax.
> >
> > > What I am missing here?
> > > I have downloaded bsh-2.0b4.jar from www.beanshell.org into my lib directory
> > >
> > >
> > > Regards,
> > > David Schulberg
> > >
> > > Object Consulting | Senior Consultant
> > > email: david.schulberg@objectconsulting.com.au
> > > ----------------------------------------------------------------
> > > consulting | development | training | support
> > > our experience makes the difference
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Beanshells

Posted by sebb <se...@gmail.com>.
See the Javadoc for SampleResult:

http://jakarta.apache.org/jmeter/api/org/apache/jmeter/samplers/SampleResult.html#getAssertionResults()

The SampleResult object is available in the "prev" variable.

On 10/08/07, David Schulberg <Da...@objectconsulting.com.au> wrote:
> Hi,
>
> Is there a way to grab an assertion result using a Beanshell post-processor?
>
> David Schulberg
>
> Object Consulting | Senior Consultant
> email: david.schulberg@objectconsulting.com.au
> ----------------------------------------------------------------
> consulting | development | training | support
> our experience makes the difference
>
> ________________________________
>
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Thu 9/08/2007 9:02 PM
> To: JMeter Users List
> Subject: Re: Beanshells
>
>
>
> On 03/08/07, David Schulberg <Da...@objectconsulting.com.au> wrote:
> > Hi,
> >
> > I have put some simple statements into beanshell scripts but I am always getting errors like
> >
> > In PreProcessor:
> > 16:03:44 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``// set up some vars for substitution on queries int studentId = 100000+Integer.parseInt("${__threadNum}"); ''
> >
> > In Listener:
> > 15:46:28 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``print sampleResult();'' : Class: print not found in namespace
>
> The correct syntax is:
>
> print(object);
>
> Try starting with a very simple script such as:
>
> print("test");
>
> and work from there.
>
> Beanshell uses Java syntax.
>
> > What I am missing here?
> > I have downloaded bsh-2.0b4.jar from www.beanshell.org into my lib directory
> >
> >
> > Regards,
> > David Schulberg
> >
> > Object Consulting | Senior Consultant
> > email: david.schulberg@objectconsulting.com.au
> > ----------------------------------------------------------------
> > consulting | development | training | support
> > our experience makes the difference
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


RE: Beanshells

Posted by David Schulberg <Da...@objectconsulting.com.au>.
Hi,
 
Is there a way to grab an assertion result using a Beanshell post-processor?
 
David Schulberg

Object Consulting | Senior Consultant
email: david.schulberg@objectconsulting.com.au
----------------------------------------------------------------
consulting | development | training | support
our experience makes the difference 

________________________________

From: sebb [mailto:sebbaz@gmail.com]
Sent: Thu 9/08/2007 9:02 PM
To: JMeter Users List
Subject: Re: Beanshells



On 03/08/07, David Schulberg <Da...@objectconsulting.com.au> wrote:
> Hi,
>
> I have put some simple statements into beanshell scripts but I am always getting errors like
>
> In PreProcessor:
> 16:03:44 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``// set up some vars for substitution on queries int studentId = 100000+Integer.parseInt("${__threadNum}"); ''
>
> In Listener:
> 15:46:28 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``print sampleResult();'' : Class: print not found in namespace

The correct syntax is:

print(object);

Try starting with a very simple script such as:

print("test");

and work from there.

Beanshell uses Java syntax.

> What I am missing here?
> I have downloaded bsh-2.0b4.jar from www.beanshell.org into my lib directory
>
>
> Regards,
> David Schulberg
>
> Object Consulting | Senior Consultant
> email: david.schulberg@objectconsulting.com.au
> ----------------------------------------------------------------
> consulting | development | training | support
> our experience makes the difference
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org





Re: Beanshells

Posted by sebb <se...@gmail.com>.
On 03/08/07, David Schulberg <Da...@objectconsulting.com.au> wrote:
> Hi,
>
> I have put some simple statements into beanshell scripts but I am always getting errors like
>
> In PreProcessor:
> 16:03:44 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``// set up some vars for substitution on queries int studentId = 100000+Integer.parseInt("${__threadNum}"); ''
>
> In Listener:
> 15:46:28 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``print sampleResult();'' : Class: print not found in namespace

The correct syntax is:

print(object);

Try starting with a very simple script such as:

print("test");

and work from there.

Beanshell uses Java syntax.

> What I am missing here?
> I have downloaded bsh-2.0b4.jar from www.beanshell.org into my lib directory
>
>
> Regards,
> David Schulberg
>
> Object Consulting | Senior Consultant
> email: david.schulberg@objectconsulting.com.au
> ----------------------------------------------------------------
> consulting | development | training | support
> our experience makes the difference
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org