jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tarun Khurana" <tarun.khur...@induslogic.com>
Subject RE: How to use Beanshell Listener
Date Fri, 04 Aug 2006 07:07:10 GMT
Hi, 

I did write the following script in the Beanshell sampler but then its still
giving an exception


import java.io.*

 public class SniffTest
{
	public void makefile()
	 {

	    	try{
		            String outfile = "C:\\output1.txt";
		            BufferedWriter out = new BufferedWriter(new
FileWriter(outfile));
		            out.write("${sitemap}");
		            out.close();    	
		            print("${sitemap}")	
	                                  }
 

   	catch(Exception e){
    		
    	}
    
}
}

Not too sure as this is running properly as a java file.

Regards
Tarun

-----Original Message-----
From: prakash abraham [mailto:prakashma@gmail.com] 
Sent: Friday, August 04, 2006 11:50 AM
To: JMeter Users List
Subject: Re: How to use Beanshell Listener

we can access all the java packages in beanshell script,
just import the java.io.* and create a file and log your data to it as you
do with normal java pgms.


On 8/4/06, Tarun Khurana <tarun.khurana@induslogic.com> wrote:
>
>
> I Have been able to use the Beanshell sampler to output the value of a
> variable to the command prompt using the print command. Can anyone tell me
> how to log the same data to a log file and which command do we need to use
> in this case.
>
> Regards
> Tarun
>
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Thursday, August 03, 2006 11:39 PM
> To: JMeter Users List
> Subject: Re: How to use Beanshell Listener
>
> http://jakarta.apache.org/jmeter/usermanual/get-started.html
>
>
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BeanShe
> ll_Sampler
>
>
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BeanShe
> ll_Assertion
>
> On 03/08/06, Chris Hansen <tchansen@xmission.com> wrote:
> > Hey sebb, you just answered a question that I hadn't asked (yet) since
> I'm
> a bit
> > overloaded - I couldn't get beanshell running either and didn't realize
> that I
> > needed to put the beanshell.jar into the lib directory.
> >
> > I'm sure I would have found mention of that in the documentation; I just
> hadn't
> > got that far.
> >
> > Thanks!
> >
> > chris
> >
> > sebb wrote:
> > > Download the beanshell jar and put it in the lib directory.
> > >
> > > Read the BeanShell documentation and
> > >
> > >
>
>
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BeanShe
> ll_Listener
> > >
> > >
> > > and the JavaDoc for sampleEvent and sampleResult.
> > >
> > > The rest is up to you - I've never needed to use it; I just added for
> > > completeness and because someone asked for it.
> > >
> > > What are you trying to do?
> > >
> > > On 03/08/06, Tarun Khurana <tarun.khurana@induslogic.com> wrote:
> > >> Hi sebb,
> > >>
> > >> Could you please tell me how to use the BeanShell listener.
> > >>
> > >> Regards
> > >> Tarun
> > >>
> > >>
> > >>
> > >> ---------------------------------------------------------------------
> > >> 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
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message