This won't execute anything, as there is no call to makefile().

Remove the class and method wrappers, and just include the code.

S.
On 04/08/06, Tarun Khurana <[EMAIL PROTECTED]> wrote:
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:[EMAIL PROTECTED]
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 <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED]
> 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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> wrote:
> > >> Hi sebb,
> > >>
> > >> Could you please tell me how to use the BeanShell listener.
> > >>
> > >> Regards
> > >> Tarun
> > >>
> > >>
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>
> > >>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to