You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by cham <ch...@hotmail.com> on 2008/07/07 17:30:27 UTC

external java script function

Hello eveybody, 
I have a js script that I need to call using the javascript function in
JMeter. But I dont know how to call it? 
I understood that the users of jemeter can define their own functions but I
dont know how. 
Any suggestions ? 

Thanx in advance 
-- 
View this message in context: http://www.nabble.com/external-java-script-function-tp18319419p18319419.html
Sent from the JMeter - User mailing list archive at Nabble.com.


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


Re: external java script function

Posted by sebb <se...@gmail.com>.
On 10/07/2008, cham <ch...@hotmail.com> wrote:
>
>  hemm, now I will dare to ask the most idiot question %-|
>  I think that my problem now is with writing the simplset js script in the
>  world!!! I added a BSF Assertion, and I specified the used language
>  "javascript" then I specify the location of my famous js file. But the
>  problem is with my script I wrote this
>  this.write("hello world"); and ofcourse I got a failure msg.
>

Yes, because there is no document.

You need to write a stand-alone Javascript app; have a look at the
JSLint example.

>  thanx
>
>
>  sebb-2-2 wrote:
>  >
>  > The BSF Assertion:
>  >
>  > http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Assertion
>  >
>  > can process Javascript from a file.
>  >
>  > It can also pass parameters to that file.
>  >
>  > You may have to write a wrapper script and/or adapt the command-line
>  > script available from the JSLint website.
>  >
>  > I suggest you start with a simple "Hello World" type script and
>  > proceed from there.
>  >
>  > On 10/07/2008, cham <ch...@hotmail.com> wrote:
>  >>
>  >>  what about calling an external js file from JMeter?
>  >>  I have the result of my Sampler which is a JSON file, and I want to
>  >>  interpret it using JSlint (which is written in javascript) is that
>  >> possible?
>  >>  Regards
>  >>
>  >>
>  >>  sebb-2-2 wrote:
>  >>  >
>  >>  > Yes, and it works.
>  >>  >
>  >>  > Try the script:
>  >>  >
>  >>  > AssertionResult.setFailureMessage("The assertion failed") ;
>  >>  > AssertionResult.setFailure(true);
>  >>  >
>  >>  > see:
>  >>  >
>  >>  >
>  >> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Assertion
>  >>  >
>  >>  > On 09/07/2008, cham <ch...@hotmail.com> wrote:
>  >>  >>
>  >>  >>  Did u try before to run javascript using BSF Assertion?
>  >>  >>  Cham
>  >>  >>
>  >>  >>
>  >>  >>  sebb-2-2 wrote:
>  >>  >>  >
>  >>  >>  > On 08/07/2008, cham <ch...@hotmail.com> wrote:
>  >>  >>  >>
>  >>  >>  >>  Hi again,
>  >>  >>  >>  actually what I am doing now is trying to validate the syntaxe
>  >> of my
>  >>  >>  >> sampler
>  >>  >>  >>  HTTP result.
>  >>  >>  >>  I used (save responses to a file) to save my json file, and what
>  >> I
>  >>  >> need
>  >>  >>  >> now
>  >>  >>  >>  is to try one of the followings:
>  >>  >>  >>  * Try to integrate JSLint in JMeter to do the validation.
>  >>  >>  >>  * Try to write a function that read the result file and validate
>  >> the
>  >>  >>  >>  syntaxe.
>  >>  >>  >>  I dont know if the implementation one of these methods is
>  >>  >> possible!!!
>  >>  >>  >
>  >>  >>  > It looks like JSLint is available in a Rhinoscript version.
>  >>  >>  >
>  >>  >>  > You could write your own Assertion to do this, or use
>  >> BSF/Javascript
>  >>  >>  > Assertion:
>  >>  >>  >
>  >>  >>  >
>  >>  >>
>  >> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Assertion
>  >>  >>  >
>  >>  >>  >>  Regards,
>  >>  >>  >>  Cham
>  >>  >>  >>
>  >>  >>  >>
>  >>  >>  >>  kirk-17 wrote:
>  >>  >>  >>  >
>  >>  >>  >>  > Hi,
>  >>  >>  >>  >
>  >>  >>  >>  > I've not found a good way to run JavaScript. Many of the
>  >>  >> interesting
>  >>  >>  >>  > scripts
>  >>  >>  >>  > rely on the DOM. JMeter doesn't have a DOM.... The best I've
>  >> been
>  >>  >> able
>  >>  >>  >> to
>  >>  >>  >>  > do
>  >>  >>  >>  > if figure out what is needed from the JS and use BeanShell to
>  >> make
>  >>  >> it
>  >>  >>  >>  > work.
>  >>  >>  >>  >
>  >>  >>  >>  > Regards,
>  >>  >>  >>  > Kirk
>  >>  >>  >>  >
>  >>  >>  >>  > On Tue, Jul 8, 2008 at 9:13 AM, Andrey Beznogov
>  >>  >>  >> <an...@googlemail.com>
>  >>  >>  >>  > wrote:
>  >>  >>  >>  >
>  >>  >>  >>  >> Hi,
>  >>  >>  >>  >>
>  >>  >>  >>  >> I never tried it myself, but as I understand you can use the
>  >> BSF
>  >>  >>  >>  >> Sampler element, which can process the JavaScript you put
>  >> into
>  >>  >> it.
>  >>  >>  >>  >>
>  >>  >>  >>  >>
>  >>  >>  >>  >>
>  >>  >>  >>
>  >>  >>
>  >> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Sampler
>  >>  >>  >>  >>
>  >>  >>  >>  >> I hope that helps.
>  >>  >>  >>  >>
>  >>  >>  >>  >> Andrey
>  >>  >>  >>  >>
>  >>  >>  >>  >> On Mon, Jul 7, 2008 at 7:30 PM, cham <ch...@hotmail.com>
>  >>  >> wrote:
>  >>  >>  >>  >> >
>  >>  >>  >>  >> > Hello eveybody,
>  >>  >>  >>  >> > I have a js script that I need to call using the javascript
>  >>  >>  >> function in
>  >>  >>  >>  >> > JMeter. But I dont know how to call it?
>  >>  >>  >>  >> > I understood that the users of jemeter can define their own
>  >>  >>  >> functions
>  >>  >>  >>  >> but
>  >>  >>  >>  >> I
>  >>  >>  >>  >> > dont know how.
>  >>  >>  >>  >> > Any suggestions ?
>  >>  >>  >>  >> >
>  >>  >>  >>  >> > Thanx in advance
>  >>  >>  >>  >> > --
>  >>  >>  >>  >> > View this message in context:
>  >>  >>  >>  >>
>  >>  >>  >>
>  >>  >>
>  >> http://www.nabble.com/external-java-script-function-tp18319419p18319419.html
>  >>  >>  >>  >> > Sent from the JMeter - User mailing list archive at
>  >> Nabble.com.
>  >>  >>  >>  >> >
>  >>  >>  >>  >> >
>  >>  >>  >>  >> >
>  >>  >>  >>
>  >> ---------------------------------------------------------------------
>  >>  >>  >>  >> > To unsubscribe, e-mail:
>  >>  >> jmeter-user-unsubscribe@jakarta.apache.org
>  >>  >>  >>  >> > For additional commands, e-mail:
>  >>  >>  >> jmeter-user-help@jakarta.apache.org
>  >>  >>  >>  >> >
>  >>  >>  >>  >> >
>  >>  >>  >>  >>
>  >>  >>  >>  >>
>  >>  >>  >>  >>
>  >>  >>  >>  >> --
>  >>  >>  >>  >> diem perdidi
>  >>  >>  >>  >>
>  >>  >>  >>  >>
>  >>  >> ---------------------------------------------------------------------
>  >>  >>  >>  >> To unsubscribe, e-mail:
>  >>  >> jmeter-user-unsubscribe@jakarta.apache.org
>  >>  >>  >>  >> For additional commands, e-mail:
>  >>  >> jmeter-user-help@jakarta.apache.org
>  >>  >>  >>  >>
>  >>  >>  >>  >>
>  >>  >>  >>  >
>  >>  >>  >>  >
>  >>  >>  >>  > --
>  >>  >>  >>  > Kind regards,
>  >>  >>  >>  > Kirk Pepperdine
>  >>  >>  >>  >
>  >>  >>  >>  > http://www.kodewerk.com
>  >>  >>  >>  > http://www.javaperformancetuning.com
>  >>  >>  >>  > http//www.cretesoft.com
>  >>  >>  >>  >
>  >>  >>  >>  >
>  >>  >>  >>
>  >>  >>  >>
>  >>  >>  >> --
>  >>  >>  >>  View this message in context:
>  >>  >>  >>
>  >>  >>
>  >> http://www.nabble.com/external-java-script-function-tp18319419p18338549.html
>  >>  >>  >>
>  >>  >>  >> Sent from the JMeter - User mailing list archive at Nabble.com.
>  >>  >>  >>
>  >>  >>  >>
>  >>  >>  >>
>  >>  >> ---------------------------------------------------------------------
>  >>  >>  >>  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
>  >>  >>  >
>  >>  >>  >
>  >>  >>  >
>  >>  >>
>  >>  >>  --
>  >>  >>
>  >>  >> View this message in context:
>  >>  >>
>  >> http://www.nabble.com/external-java-script-function-tp18319419p18355957.html
>  >>  >>
>  >>  >> Sent from the JMeter - User mailing list archive at Nabble.com.
>  >>  >>
>  >>  >>
>  >>  >>
>  >> ---------------------------------------------------------------------
>  >>  >>  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
>  >>  >
>  >>  >
>  >>  >
>  >>
>  >>  --
>  >>
>  >> View this message in context:
>  >> http://www.nabble.com/external-java-script-function-tp18319419p18382459.html
>  >>
>  >> Sent from the JMeter - User mailing list archive at Nabble.com.
>  >>
>  >>
>  >>  ---------------------------------------------------------------------
>  >>  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
>  >
>  >
>  >
>
>  --
>
> View this message in context: http://www.nabble.com/external-java-script-function-tp18319419p18384413.html
>
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  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: external java script function

Posted by cham <ch...@hotmail.com>.
hemm, now I will dare to ask the most idiot question %-|
I think that my problem now is with writing the simplset js script in the
world!!! I added a BSF Assertion, and I specified the used language
"javascript" then I specify the location of my famous js file. But the
problem is with my script I wrote this 
this.write("hello world"); and ofcourse I got a failure msg. 

thanx  

sebb-2-2 wrote:
> 
> The BSF Assertion:
> 
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Assertion
> 
> can process Javascript from a file.
> 
> It can also pass parameters to that file.
> 
> You may have to write a wrapper script and/or adapt the command-line
> script available from the JSLint website.
> 
> I suggest you start with a simple "Hello World" type script and
> proceed from there.
> 
> On 10/07/2008, cham <ch...@hotmail.com> wrote:
>>
>>  what about calling an external js file from JMeter?
>>  I have the result of my Sampler which is a JSON file, and I want to
>>  interpret it using JSlint (which is written in javascript) is that
>> possible?
>>  Regards
>>
>>
>>  sebb-2-2 wrote:
>>  >
>>  > Yes, and it works.
>>  >
>>  > Try the script:
>>  >
>>  > AssertionResult.setFailureMessage("The assertion failed") ;
>>  > AssertionResult.setFailure(true);
>>  >
>>  > see:
>>  >
>>  >
>> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Assertion
>>  >
>>  > On 09/07/2008, cham <ch...@hotmail.com> wrote:
>>  >>
>>  >>  Did u try before to run javascript using BSF Assertion?
>>  >>  Cham
>>  >>
>>  >>
>>  >>  sebb-2-2 wrote:
>>  >>  >
>>  >>  > On 08/07/2008, cham <ch...@hotmail.com> wrote:
>>  >>  >>
>>  >>  >>  Hi again,
>>  >>  >>  actually what I am doing now is trying to validate the syntaxe
>> of my
>>  >>  >> sampler
>>  >>  >>  HTTP result.
>>  >>  >>  I used (save responses to a file) to save my json file, and what
>> I
>>  >> need
>>  >>  >> now
>>  >>  >>  is to try one of the followings:
>>  >>  >>  * Try to integrate JSLint in JMeter to do the validation.
>>  >>  >>  * Try to write a function that read the result file and validate
>> the
>>  >>  >>  syntaxe.
>>  >>  >>  I dont know if the implementation one of these methods is
>>  >> possible!!!
>>  >>  >
>>  >>  > It looks like JSLint is available in a Rhinoscript version.
>>  >>  >
>>  >>  > You could write your own Assertion to do this, or use 
>> BSF/Javascript
>>  >>  > Assertion:
>>  >>  >
>>  >>  >
>>  >>
>> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Assertion
>>  >>  >
>>  >>  >>  Regards,
>>  >>  >>  Cham
>>  >>  >>
>>  >>  >>
>>  >>  >>  kirk-17 wrote:
>>  >>  >>  >
>>  >>  >>  > Hi,
>>  >>  >>  >
>>  >>  >>  > I've not found a good way to run JavaScript. Many of the
>>  >> interesting
>>  >>  >>  > scripts
>>  >>  >>  > rely on the DOM. JMeter doesn't have a DOM.... The best I've
>> been
>>  >> able
>>  >>  >> to
>>  >>  >>  > do
>>  >>  >>  > if figure out what is needed from the JS and use BeanShell to
>> make
>>  >> it
>>  >>  >>  > work.
>>  >>  >>  >
>>  >>  >>  > Regards,
>>  >>  >>  > Kirk
>>  >>  >>  >
>>  >>  >>  > On Tue, Jul 8, 2008 at 9:13 AM, Andrey Beznogov
>>  >>  >> <an...@googlemail.com>
>>  >>  >>  > wrote:
>>  >>  >>  >
>>  >>  >>  >> Hi,
>>  >>  >>  >>
>>  >>  >>  >> I never tried it myself, but as I understand you can use the
>> BSF
>>  >>  >>  >> Sampler element, which can process the JavaScript you put
>> into
>>  >> it.
>>  >>  >>  >>
>>  >>  >>  >>
>>  >>  >>  >>
>>  >>  >>
>>  >>
>> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Sampler
>>  >>  >>  >>
>>  >>  >>  >> I hope that helps.
>>  >>  >>  >>
>>  >>  >>  >> Andrey
>>  >>  >>  >>
>>  >>  >>  >> On Mon, Jul 7, 2008 at 7:30 PM, cham <ch...@hotmail.com>
>>  >> wrote:
>>  >>  >>  >> >
>>  >>  >>  >> > Hello eveybody,
>>  >>  >>  >> > I have a js script that I need to call using the javascript
>>  >>  >> function in
>>  >>  >>  >> > JMeter. But I dont know how to call it?
>>  >>  >>  >> > I understood that the users of jemeter can define their own
>>  >>  >> functions
>>  >>  >>  >> but
>>  >>  >>  >> I
>>  >>  >>  >> > dont know how.
>>  >>  >>  >> > Any suggestions ?
>>  >>  >>  >> >
>>  >>  >>  >> > Thanx in advance
>>  >>  >>  >> > --
>>  >>  >>  >> > View this message in context:
>>  >>  >>  >>
>>  >>  >>
>>  >>
>> http://www.nabble.com/external-java-script-function-tp18319419p18319419.html
>>  >>  >>  >> > Sent from the JMeter - User mailing list archive at
>> Nabble.com.
>>  >>  >>  >> >
>>  >>  >>  >> >
>>  >>  >>  >> >
>>  >>  >>
>> ---------------------------------------------------------------------
>>  >>  >>  >> > To unsubscribe, e-mail:
>>  >> jmeter-user-unsubscribe@jakarta.apache.org
>>  >>  >>  >> > For additional commands, e-mail:
>>  >>  >> jmeter-user-help@jakarta.apache.org
>>  >>  >>  >> >
>>  >>  >>  >> >
>>  >>  >>  >>
>>  >>  >>  >>
>>  >>  >>  >>
>>  >>  >>  >> --
>>  >>  >>  >> diem perdidi
>>  >>  >>  >>
>>  >>  >>  >>
>>  >> ---------------------------------------------------------------------
>>  >>  >>  >> To unsubscribe, e-mail:
>>  >> jmeter-user-unsubscribe@jakarta.apache.org
>>  >>  >>  >> For additional commands, e-mail:
>>  >> jmeter-user-help@jakarta.apache.org
>>  >>  >>  >>
>>  >>  >>  >>
>>  >>  >>  >
>>  >>  >>  >
>>  >>  >>  > --
>>  >>  >>  > Kind regards,
>>  >>  >>  > Kirk Pepperdine
>>  >>  >>  >
>>  >>  >>  > http://www.kodewerk.com
>>  >>  >>  > http://www.javaperformancetuning.com
>>  >>  >>  > http//www.cretesoft.com
>>  >>  >>  >
>>  >>  >>  >
>>  >>  >>
>>  >>  >>
>>  >>  >> --
>>  >>  >>  View this message in context:
>>  >>  >>
>>  >>
>> http://www.nabble.com/external-java-script-function-tp18319419p18338549.html
>>  >>  >>
>>  >>  >> Sent from the JMeter - User mailing list archive at Nabble.com.
>>  >>  >>
>>  >>  >>
>>  >>  >>
>>  >> ---------------------------------------------------------------------
>>  >>  >>  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
>>  >>  >
>>  >>  >
>>  >>  >
>>  >>
>>  >>  --
>>  >>
>>  >> View this message in context:
>>  >>
>> http://www.nabble.com/external-java-script-function-tp18319419p18355957.html
>>  >>
>>  >> Sent from the JMeter - User mailing list archive at Nabble.com.
>>  >>
>>  >>
>>  >> 
>> ---------------------------------------------------------------------
>>  >>  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
>>  >
>>  >
>>  >
>>
>>  --
>>
>> View this message in context:
>> http://www.nabble.com/external-java-script-function-tp18319419p18382459.html
>>
>> Sent from the JMeter - User mailing list archive at Nabble.com.
>>
>>
>>  ---------------------------------------------------------------------
>>  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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/external-java-script-function-tp18319419p18384413.html
Sent from the JMeter - User mailing list archive at Nabble.com.


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


Re: external java script function

Posted by sebb <se...@gmail.com>.
The BSF Assertion:

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Assertion

can process Javascript from a file.

It can also pass parameters to that file.

You may have to write a wrapper script and/or adapt the command-line
script available from the JSLint website.

I suggest you start with a simple "Hello World" type script and
proceed from there.

On 10/07/2008, cham <ch...@hotmail.com> wrote:
>
>  what about calling an external js file from JMeter?
>  I have the result of my Sampler which is a JSON file, and I want to
>  interpret it using JSlint (which is written in javascript) is that possible?
>  Regards
>
>
>  sebb-2-2 wrote:
>  >
>  > Yes, and it works.
>  >
>  > Try the script:
>  >
>  > AssertionResult.setFailureMessage("The assertion failed") ;
>  > AssertionResult.setFailure(true);
>  >
>  > see:
>  >
>  > http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Assertion
>  >
>  > On 09/07/2008, cham <ch...@hotmail.com> wrote:
>  >>
>  >>  Did u try before to run javascript using BSF Assertion?
>  >>  Cham
>  >>
>  >>
>  >>  sebb-2-2 wrote:
>  >>  >
>  >>  > On 08/07/2008, cham <ch...@hotmail.com> wrote:
>  >>  >>
>  >>  >>  Hi again,
>  >>  >>  actually what I am doing now is trying to validate the syntaxe of my
>  >>  >> sampler
>  >>  >>  HTTP result.
>  >>  >>  I used (save responses to a file) to save my json file, and what I
>  >> need
>  >>  >> now
>  >>  >>  is to try one of the followings:
>  >>  >>  * Try to integrate JSLint in JMeter to do the validation.
>  >>  >>  * Try to write a function that read the result file and validate the
>  >>  >>  syntaxe.
>  >>  >>  I dont know if the implementation one of these methods is
>  >> possible!!!
>  >>  >
>  >>  > It looks like JSLint is available in a Rhinoscript version.
>  >>  >
>  >>  > You could write your own Assertion to do this, or use  BSF/Javascript
>  >>  > Assertion:
>  >>  >
>  >>  >
>  >> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Assertion
>  >>  >
>  >>  >>  Regards,
>  >>  >>  Cham
>  >>  >>
>  >>  >>
>  >>  >>  kirk-17 wrote:
>  >>  >>  >
>  >>  >>  > Hi,
>  >>  >>  >
>  >>  >>  > I've not found a good way to run JavaScript. Many of the
>  >> interesting
>  >>  >>  > scripts
>  >>  >>  > rely on the DOM. JMeter doesn't have a DOM.... The best I've been
>  >> able
>  >>  >> to
>  >>  >>  > do
>  >>  >>  > if figure out what is needed from the JS and use BeanShell to make
>  >> it
>  >>  >>  > work.
>  >>  >>  >
>  >>  >>  > Regards,
>  >>  >>  > Kirk
>  >>  >>  >
>  >>  >>  > On Tue, Jul 8, 2008 at 9:13 AM, Andrey Beznogov
>  >>  >> <an...@googlemail.com>
>  >>  >>  > wrote:
>  >>  >>  >
>  >>  >>  >> Hi,
>  >>  >>  >>
>  >>  >>  >> I never tried it myself, but as I understand you can use the BSF
>  >>  >>  >> Sampler element, which can process the JavaScript you put into
>  >> it.
>  >>  >>  >>
>  >>  >>  >>
>  >>  >>  >>
>  >>  >>
>  >> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Sampler
>  >>  >>  >>
>  >>  >>  >> I hope that helps.
>  >>  >>  >>
>  >>  >>  >> Andrey
>  >>  >>  >>
>  >>  >>  >> On Mon, Jul 7, 2008 at 7:30 PM, cham <ch...@hotmail.com>
>  >> wrote:
>  >>  >>  >> >
>  >>  >>  >> > Hello eveybody,
>  >>  >>  >> > I have a js script that I need to call using the javascript
>  >>  >> function in
>  >>  >>  >> > JMeter. But I dont know how to call it?
>  >>  >>  >> > I understood that the users of jemeter can define their own
>  >>  >> functions
>  >>  >>  >> but
>  >>  >>  >> I
>  >>  >>  >> > dont know how.
>  >>  >>  >> > Any suggestions ?
>  >>  >>  >> >
>  >>  >>  >> > Thanx in advance
>  >>  >>  >> > --
>  >>  >>  >> > View this message in context:
>  >>  >>  >>
>  >>  >>
>  >> http://www.nabble.com/external-java-script-function-tp18319419p18319419.html
>  >>  >>  >> > Sent from the JMeter - User mailing list archive at Nabble.com.
>  >>  >>  >> >
>  >>  >>  >> >
>  >>  >>  >> >
>  >>  >> ---------------------------------------------------------------------
>  >>  >>  >> > To unsubscribe, e-mail:
>  >> jmeter-user-unsubscribe@jakarta.apache.org
>  >>  >>  >> > For additional commands, e-mail:
>  >>  >> jmeter-user-help@jakarta.apache.org
>  >>  >>  >> >
>  >>  >>  >> >
>  >>  >>  >>
>  >>  >>  >>
>  >>  >>  >>
>  >>  >>  >> --
>  >>  >>  >> diem perdidi
>  >>  >>  >>
>  >>  >>  >>
>  >> ---------------------------------------------------------------------
>  >>  >>  >> To unsubscribe, e-mail:
>  >> jmeter-user-unsubscribe@jakarta.apache.org
>  >>  >>  >> For additional commands, e-mail:
>  >> jmeter-user-help@jakarta.apache.org
>  >>  >>  >>
>  >>  >>  >>
>  >>  >>  >
>  >>  >>  >
>  >>  >>  > --
>  >>  >>  > Kind regards,
>  >>  >>  > Kirk Pepperdine
>  >>  >>  >
>  >>  >>  > http://www.kodewerk.com
>  >>  >>  > http://www.javaperformancetuning.com
>  >>  >>  > http//www.cretesoft.com
>  >>  >>  >
>  >>  >>  >
>  >>  >>
>  >>  >>
>  >>  >> --
>  >>  >>  View this message in context:
>  >>  >>
>  >> http://www.nabble.com/external-java-script-function-tp18319419p18338549.html
>  >>  >>
>  >>  >> Sent from the JMeter - User mailing list archive at Nabble.com.
>  >>  >>
>  >>  >>
>  >>  >>
>  >> ---------------------------------------------------------------------
>  >>  >>  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
>  >>  >
>  >>  >
>  >>  >
>  >>
>  >>  --
>  >>
>  >> View this message in context:
>  >> http://www.nabble.com/external-java-script-function-tp18319419p18355957.html
>  >>
>  >> Sent from the JMeter - User mailing list archive at Nabble.com.
>  >>
>  >>
>  >>  ---------------------------------------------------------------------
>  >>  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
>  >
>  >
>  >
>
>  --
>
> View this message in context: http://www.nabble.com/external-java-script-function-tp18319419p18382459.html
>
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  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: external java script function

Posted by cham <ch...@hotmail.com>.
what about calling an external js file from JMeter? 
I have the result of my Sampler which is a JSON file, and I want to
interpret it using JSlint (which is written in javascript) is that possible? 
Regards 

sebb-2-2 wrote:
> 
> Yes, and it works.
> 
> Try the script:
> 
> AssertionResult.setFailureMessage("The assertion failed") ;
> AssertionResult.setFailure(true);
> 
> see:
> 
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Assertion
> 
> On 09/07/2008, cham <ch...@hotmail.com> wrote:
>>
>>  Did u try before to run javascript using BSF Assertion?
>>  Cham
>>
>>
>>  sebb-2-2 wrote:
>>  >
>>  > On 08/07/2008, cham <ch...@hotmail.com> wrote:
>>  >>
>>  >>  Hi again,
>>  >>  actually what I am doing now is trying to validate the syntaxe of my
>>  >> sampler
>>  >>  HTTP result.
>>  >>  I used (save responses to a file) to save my json file, and what I
>> need
>>  >> now
>>  >>  is to try one of the followings:
>>  >>  * Try to integrate JSLint in JMeter to do the validation.
>>  >>  * Try to write a function that read the result file and validate the
>>  >>  syntaxe.
>>  >>  I dont know if the implementation one of these methods is
>> possible!!!
>>  >
>>  > It looks like JSLint is available in a Rhinoscript version.
>>  >
>>  > You could write your own Assertion to do this, or use  BSF/Javascript
>>  > Assertion:
>>  >
>>  >
>> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Assertion
>>  >
>>  >>  Regards,
>>  >>  Cham
>>  >>
>>  >>
>>  >>  kirk-17 wrote:
>>  >>  >
>>  >>  > Hi,
>>  >>  >
>>  >>  > I've not found a good way to run JavaScript. Many of the
>> interesting
>>  >>  > scripts
>>  >>  > rely on the DOM. JMeter doesn't have a DOM.... The best I've been
>> able
>>  >> to
>>  >>  > do
>>  >>  > if figure out what is needed from the JS and use BeanShell to make
>> it
>>  >>  > work.
>>  >>  >
>>  >>  > Regards,
>>  >>  > Kirk
>>  >>  >
>>  >>  > On Tue, Jul 8, 2008 at 9:13 AM, Andrey Beznogov
>>  >> <an...@googlemail.com>
>>  >>  > wrote:
>>  >>  >
>>  >>  >> Hi,
>>  >>  >>
>>  >>  >> I never tried it myself, but as I understand you can use the BSF
>>  >>  >> Sampler element, which can process the JavaScript you put into
>> it.
>>  >>  >>
>>  >>  >>
>>  >>  >>
>>  >>
>> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Sampler
>>  >>  >>
>>  >>  >> I hope that helps.
>>  >>  >>
>>  >>  >> Andrey
>>  >>  >>
>>  >>  >> On Mon, Jul 7, 2008 at 7:30 PM, cham <ch...@hotmail.com>
>> wrote:
>>  >>  >> >
>>  >>  >> > Hello eveybody,
>>  >>  >> > I have a js script that I need to call using the javascript
>>  >> function in
>>  >>  >> > JMeter. But I dont know how to call it?
>>  >>  >> > I understood that the users of jemeter can define their own
>>  >> functions
>>  >>  >> but
>>  >>  >> I
>>  >>  >> > dont know how.
>>  >>  >> > Any suggestions ?
>>  >>  >> >
>>  >>  >> > Thanx in advance
>>  >>  >> > --
>>  >>  >> > View this message in context:
>>  >>  >>
>>  >>
>> http://www.nabble.com/external-java-script-function-tp18319419p18319419.html
>>  >>  >> > Sent from the JMeter - User mailing list archive at Nabble.com.
>>  >>  >> >
>>  >>  >> >
>>  >>  >> >
>>  >> ---------------------------------------------------------------------
>>  >>  >> > To unsubscribe, e-mail:
>> jmeter-user-unsubscribe@jakarta.apache.org
>>  >>  >> > For additional commands, e-mail:
>>  >> jmeter-user-help@jakarta.apache.org
>>  >>  >> >
>>  >>  >> >
>>  >>  >>
>>  >>  >>
>>  >>  >>
>>  >>  >> --
>>  >>  >> diem perdidi
>>  >>  >>
>>  >>  >>
>> ---------------------------------------------------------------------
>>  >>  >> To unsubscribe, e-mail:
>> jmeter-user-unsubscribe@jakarta.apache.org
>>  >>  >> For additional commands, e-mail:
>> jmeter-user-help@jakarta.apache.org
>>  >>  >>
>>  >>  >>
>>  >>  >
>>  >>  >
>>  >>  > --
>>  >>  > Kind regards,
>>  >>  > Kirk Pepperdine
>>  >>  >
>>  >>  > http://www.kodewerk.com
>>  >>  > http://www.javaperformancetuning.com
>>  >>  > http//www.cretesoft.com
>>  >>  >
>>  >>  >
>>  >>
>>  >>
>>  >> --
>>  >>  View this message in context:
>>  >>
>> http://www.nabble.com/external-java-script-function-tp18319419p18338549.html
>>  >>
>>  >> Sent from the JMeter - User mailing list archive at Nabble.com.
>>  >>
>>  >>
>>  >> 
>> ---------------------------------------------------------------------
>>  >>  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
>>  >
>>  >
>>  >
>>
>>  --
>>
>> View this message in context:
>> http://www.nabble.com/external-java-script-function-tp18319419p18355957.html
>>
>> Sent from the JMeter - User mailing list archive at Nabble.com.
>>
>>
>>  ---------------------------------------------------------------------
>>  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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/external-java-script-function-tp18319419p18382459.html
Sent from the JMeter - User mailing list archive at Nabble.com.


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


Re: external java script function

Posted by sebb <se...@gmail.com>.
Yes, and it works.

Try the script:

AssertionResult.setFailureMessage("The assertion failed") ;
AssertionResult.setFailure(true);

see:

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Assertion

On 09/07/2008, cham <ch...@hotmail.com> wrote:
>
>  Did u try before to run javascript using BSF Assertion?
>  Cham
>
>
>  sebb-2-2 wrote:
>  >
>  > On 08/07/2008, cham <ch...@hotmail.com> wrote:
>  >>
>  >>  Hi again,
>  >>  actually what I am doing now is trying to validate the syntaxe of my
>  >> sampler
>  >>  HTTP result.
>  >>  I used (save responses to a file) to save my json file, and what I need
>  >> now
>  >>  is to try one of the followings:
>  >>  * Try to integrate JSLint in JMeter to do the validation.
>  >>  * Try to write a function that read the result file and validate the
>  >>  syntaxe.
>  >>  I dont know if the implementation one of these methods is possible!!!
>  >
>  > It looks like JSLint is available in a Rhinoscript version.
>  >
>  > You could write your own Assertion to do this, or use  BSF/Javascript
>  > Assertion:
>  >
>  > http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Assertion
>  >
>  >>  Regards,
>  >>  Cham
>  >>
>  >>
>  >>  kirk-17 wrote:
>  >>  >
>  >>  > Hi,
>  >>  >
>  >>  > I've not found a good way to run JavaScript. Many of the interesting
>  >>  > scripts
>  >>  > rely on the DOM. JMeter doesn't have a DOM.... The best I've been able
>  >> to
>  >>  > do
>  >>  > if figure out what is needed from the JS and use BeanShell to make it
>  >>  > work.
>  >>  >
>  >>  > Regards,
>  >>  > Kirk
>  >>  >
>  >>  > On Tue, Jul 8, 2008 at 9:13 AM, Andrey Beznogov
>  >> <an...@googlemail.com>
>  >>  > wrote:
>  >>  >
>  >>  >> Hi,
>  >>  >>
>  >>  >> I never tried it myself, but as I understand you can use the BSF
>  >>  >> Sampler element, which can process the JavaScript you put into it.
>  >>  >>
>  >>  >>
>  >>  >>
>  >> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Sampler
>  >>  >>
>  >>  >> I hope that helps.
>  >>  >>
>  >>  >> Andrey
>  >>  >>
>  >>  >> On Mon, Jul 7, 2008 at 7:30 PM, cham <ch...@hotmail.com> wrote:
>  >>  >> >
>  >>  >> > Hello eveybody,
>  >>  >> > I have a js script that I need to call using the javascript
>  >> function in
>  >>  >> > JMeter. But I dont know how to call it?
>  >>  >> > I understood that the users of jemeter can define their own
>  >> functions
>  >>  >> but
>  >>  >> I
>  >>  >> > dont know how.
>  >>  >> > Any suggestions ?
>  >>  >> >
>  >>  >> > Thanx in advance
>  >>  >> > --
>  >>  >> > View this message in context:
>  >>  >>
>  >> http://www.nabble.com/external-java-script-function-tp18319419p18319419.html
>  >>  >> > Sent from the JMeter - User mailing list archive at Nabble.com.
>  >>  >> >
>  >>  >> >
>  >>  >> >
>  >> ---------------------------------------------------------------------
>  >>  >> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  >>  >> > For additional commands, e-mail:
>  >> jmeter-user-help@jakarta.apache.org
>  >>  >> >
>  >>  >> >
>  >>  >>
>  >>  >>
>  >>  >>
>  >>  >> --
>  >>  >> diem perdidi
>  >>  >>
>  >>  >> ---------------------------------------------------------------------
>  >>  >> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  >>  >> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  >>  >>
>  >>  >>
>  >>  >
>  >>  >
>  >>  > --
>  >>  > Kind regards,
>  >>  > Kirk Pepperdine
>  >>  >
>  >>  > http://www.kodewerk.com
>  >>  > http://www.javaperformancetuning.com
>  >>  > http//www.cretesoft.com
>  >>  >
>  >>  >
>  >>
>  >>
>  >> --
>  >>  View this message in context:
>  >> http://www.nabble.com/external-java-script-function-tp18319419p18338549.html
>  >>
>  >> Sent from the JMeter - User mailing list archive at Nabble.com.
>  >>
>  >>
>  >>  ---------------------------------------------------------------------
>  >>  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
>  >
>  >
>  >
>
>  --
>
> View this message in context: http://www.nabble.com/external-java-script-function-tp18319419p18355957.html
>
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  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: external java script function

Posted by cham <ch...@hotmail.com>.
Did u try before to run javascript using BSF Assertion? 
Cham 

sebb-2-2 wrote:
> 
> On 08/07/2008, cham <ch...@hotmail.com> wrote:
>>
>>  Hi again,
>>  actually what I am doing now is trying to validate the syntaxe of my
>> sampler
>>  HTTP result.
>>  I used (save responses to a file) to save my json file, and what I need
>> now
>>  is to try one of the followings:
>>  * Try to integrate JSLint in JMeter to do the validation.
>>  * Try to write a function that read the result file and validate the
>>  syntaxe.
>>  I dont know if the implementation one of these methods is possible!!!
> 
> It looks like JSLint is available in a Rhinoscript version.
> 
> You could write your own Assertion to do this, or use  BSF/Javascript
> Assertion:
> 
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Assertion
> 
>>  Regards,
>>  Cham
>>
>>
>>  kirk-17 wrote:
>>  >
>>  > Hi,
>>  >
>>  > I've not found a good way to run JavaScript. Many of the interesting
>>  > scripts
>>  > rely on the DOM. JMeter doesn't have a DOM.... The best I've been able
>> to
>>  > do
>>  > if figure out what is needed from the JS and use BeanShell to make it
>>  > work.
>>  >
>>  > Regards,
>>  > Kirk
>>  >
>>  > On Tue, Jul 8, 2008 at 9:13 AM, Andrey Beznogov
>> <an...@googlemail.com>
>>  > wrote:
>>  >
>>  >> Hi,
>>  >>
>>  >> I never tried it myself, but as I understand you can use the BSF
>>  >> Sampler element, which can process the JavaScript you put into it.
>>  >>
>>  >>
>>  >>
>> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Sampler
>>  >>
>>  >> I hope that helps.
>>  >>
>>  >> Andrey
>>  >>
>>  >> On Mon, Jul 7, 2008 at 7:30 PM, cham <ch...@hotmail.com> wrote:
>>  >> >
>>  >> > Hello eveybody,
>>  >> > I have a js script that I need to call using the javascript
>> function in
>>  >> > JMeter. But I dont know how to call it?
>>  >> > I understood that the users of jemeter can define their own
>> functions
>>  >> but
>>  >> I
>>  >> > dont know how.
>>  >> > Any suggestions ?
>>  >> >
>>  >> > Thanx in advance
>>  >> > --
>>  >> > View this message in context:
>>  >>
>> http://www.nabble.com/external-java-script-function-tp18319419p18319419.html
>>  >> > Sent from the JMeter - User mailing list archive at Nabble.com.
>>  >> >
>>  >> >
>>  >> >
>> ---------------------------------------------------------------------
>>  >> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>  >> > For additional commands, e-mail:
>> jmeter-user-help@jakarta.apache.org
>>  >> >
>>  >> >
>>  >>
>>  >>
>>  >>
>>  >> --
>>  >> diem perdidi
>>  >>
>>  >> ---------------------------------------------------------------------
>>  >> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>  >> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>  >>
>>  >>
>>  >
>>  >
>>  > --
>>  > Kind regards,
>>  > Kirk Pepperdine
>>  >
>>  > http://www.kodewerk.com
>>  > http://www.javaperformancetuning.com
>>  > http//www.cretesoft.com
>>  >
>>  >
>>
>>
>> --
>>  View this message in context:
>> http://www.nabble.com/external-java-script-function-tp18319419p18338549.html
>>
>> Sent from the JMeter - User mailing list archive at Nabble.com.
>>
>>
>>  ---------------------------------------------------------------------
>>  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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/external-java-script-function-tp18319419p18355957.html
Sent from the JMeter - User mailing list archive at Nabble.com.


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


Re: external java script function

Posted by sebb <se...@gmail.com>.
On 08/07/2008, cham <ch...@hotmail.com> wrote:
>
>  Hi again,
>  actually what I am doing now is trying to validate the syntaxe of my sampler
>  HTTP result.
>  I used (save responses to a file) to save my json file, and what I need now
>  is to try one of the followings:
>  * Try to integrate JSLint in JMeter to do the validation.
>  * Try to write a function that read the result file and validate the
>  syntaxe.
>  I dont know if the implementation one of these methods is possible!!!

It looks like JSLint is available in a Rhinoscript version.

You could write your own Assertion to do this, or use  BSF/Javascript Assertion:

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Assertion

>  Regards,
>  Cham
>
>
>  kirk-17 wrote:
>  >
>  > Hi,
>  >
>  > I've not found a good way to run JavaScript. Many of the interesting
>  > scripts
>  > rely on the DOM. JMeter doesn't have a DOM.... The best I've been able to
>  > do
>  > if figure out what is needed from the JS and use BeanShell to make it
>  > work.
>  >
>  > Regards,
>  > Kirk
>  >
>  > On Tue, Jul 8, 2008 at 9:13 AM, Andrey Beznogov <an...@googlemail.com>
>  > wrote:
>  >
>  >> Hi,
>  >>
>  >> I never tried it myself, but as I understand you can use the BSF
>  >> Sampler element, which can process the JavaScript you put into it.
>  >>
>  >>
>  >> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Sampler
>  >>
>  >> I hope that helps.
>  >>
>  >> Andrey
>  >>
>  >> On Mon, Jul 7, 2008 at 7:30 PM, cham <ch...@hotmail.com> wrote:
>  >> >
>  >> > Hello eveybody,
>  >> > I have a js script that I need to call using the javascript function in
>  >> > JMeter. But I dont know how to call it?
>  >> > I understood that the users of jemeter can define their own functions
>  >> but
>  >> I
>  >> > dont know how.
>  >> > Any suggestions ?
>  >> >
>  >> > Thanx in advance
>  >> > --
>  >> > View this message in context:
>  >> http://www.nabble.com/external-java-script-function-tp18319419p18319419.html
>  >> > Sent from the JMeter - User mailing list archive at Nabble.com.
>  >> >
>  >> >
>  >> > ---------------------------------------------------------------------
>  >> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  >> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  >> >
>  >> >
>  >>
>  >>
>  >>
>  >> --
>  >> diem perdidi
>  >>
>  >> ---------------------------------------------------------------------
>  >> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  >> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  >>
>  >>
>  >
>  >
>  > --
>  > Kind regards,
>  > Kirk Pepperdine
>  >
>  > http://www.kodewerk.com
>  > http://www.javaperformancetuning.com
>  > http//www.cretesoft.com
>  >
>  >
>
>
> --
>  View this message in context: http://www.nabble.com/external-java-script-function-tp18319419p18338549.html
>
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  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: external java script function

Posted by cham <ch...@hotmail.com>.
Hi again, 
actually what I am doing now is trying to validate the syntaxe of my sampler
HTTP result. 
I used (save responses to a file) to save my json file, and what I need now
is to try one of the followings: 
* Try to integrate JSLint in JMeter to do the validation.  
* Try to write a function that read the result file and validate the
syntaxe. 
I dont know if the implementation one of these methods is possible!!!

Regards,
Cham 

kirk-17 wrote:
> 
> Hi,
> 
> I've not found a good way to run JavaScript. Many of the interesting
> scripts
> rely on the DOM. JMeter doesn't have a DOM.... The best I've been able to
> do
> if figure out what is needed from the JS and use BeanShell to make it
> work.
> 
> Regards,
> Kirk
> 
> On Tue, Jul 8, 2008 at 9:13 AM, Andrey Beznogov <an...@googlemail.com>
> wrote:
> 
>> Hi,
>>
>> I never tried it myself, but as I understand you can use the BSF
>> Sampler element, which can process the JavaScript you put into it.
>>
>>
>> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Sampler
>>
>> I hope that helps.
>>
>> Andrey
>>
>> On Mon, Jul 7, 2008 at 7:30 PM, cham <ch...@hotmail.com> wrote:
>> >
>> > Hello eveybody,
>> > I have a js script that I need to call using the javascript function in
>> > JMeter. But I dont know how to call it?
>> > I understood that the users of jemeter can define their own functions
>> but
>> I
>> > dont know how.
>> > Any suggestions ?
>> >
>> > Thanx in advance
>> > --
>> > View this message in context:
>> http://www.nabble.com/external-java-script-function-tp18319419p18319419.html
>> > Sent from the JMeter - User mailing list archive at Nabble.com.
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>> >
>> >
>>
>>
>>
>> --
>> diem perdidi
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
> 
> 
> -- 
> Kind regards,
> Kirk Pepperdine
> 
> http://www.kodewerk.com
> http://www.javaperformancetuning.com
> http//www.cretesoft.com
> 
> 

-- 
View this message in context: http://www.nabble.com/external-java-script-function-tp18319419p18338549.html
Sent from the JMeter - User mailing list archive at Nabble.com.


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


Re: external java script function

Posted by Kirk Pepperdine <ki...@gmail.com>.
Hi,

I've not found a good way to run JavaScript. Many of the interesting scripts
rely on the DOM. JMeter doesn't have a DOM.... The best I've been able to do
if figure out what is needed from the JS and use BeanShell to make it work.

Regards,
Kirk

On Tue, Jul 8, 2008 at 9:13 AM, Andrey Beznogov <an...@googlemail.com>
wrote:

> Hi,
>
> I never tried it myself, but as I understand you can use the BSF
> Sampler element, which can process the JavaScript you put into it.
>
>
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Sampler
>
> I hope that helps.
>
> Andrey
>
> On Mon, Jul 7, 2008 at 7:30 PM, cham <ch...@hotmail.com> wrote:
> >
> > Hello eveybody,
> > I have a js script that I need to call using the javascript function in
> > JMeter. But I dont know how to call it?
> > I understood that the users of jemeter can define their own functions but
> I
> > dont know how.
> > Any suggestions ?
> >
> > Thanx in advance
> > --
> > View this message in context:
> http://www.nabble.com/external-java-script-function-tp18319419p18319419.html
> > Sent from the JMeter - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
>
>
> --
> diem perdidi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>


-- 
Kind regards,
Kirk Pepperdine

http://www.kodewerk.com
http://www.javaperformancetuning.com
http//www.cretesoft.com

Re: external java script function

Posted by Andrey Beznogov <an...@googlemail.com>.
Hi,

I never tried it myself, but as I understand you can use the BSF
Sampler element, which can process the JavaScript you put into it.

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BSF_Sampler

I hope that helps.

Andrey

On Mon, Jul 7, 2008 at 7:30 PM, cham <ch...@hotmail.com> wrote:
>
> Hello eveybody,
> I have a js script that I need to call using the javascript function in
> JMeter. But I dont know how to call it?
> I understood that the users of jemeter can define their own functions but I
> dont know how.
> Any suggestions ?
>
> Thanx in advance
> --
> View this message in context: http://www.nabble.com/external-java-script-function-tp18319419p18319419.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>



-- 
diem perdidi

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