jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: BSF Sampler Javascript ReferenceError
Date Fri, 26 Jun 2009 12:49:24 GMT
On 25/06/2009, arjun786us <arjun786us@yahoo.com> wrote:
>
>  Hi,
>
>  I am using a BSF sampler in my JMeter test. I am specifying a javascript
>  from my bin folder.
>  the javascript is as follows
>  ---geturl.js-----
>  var message=sayHello();
>  message;
>
>  function sayHello() {
>  var some = "Hello";
>  return some;
>  }
>  ------------------
>  this runs fine.
>
>  but when I try to reference other javascript file in my original js file, I
>  get the error
>
>  Response message: org.apache.bsf.BSFException: JavaScript Error: Internal
>  Error: org.mozilla.javascript.EcmaError: ReferenceError: "load" is not
>  defined.
>
>
>  the new geturl.js file is as follows
>
>  ---geturl.js----
>  load('hi.js');
>  var message=sayHi();
>  message;
>  ------------
>  and
>  ----hi.js---
>  function sayHi() {
>  some = "Hi";
>  return some;
>  }
>  ---------
>
>  Rhino documentation at http://www.mozilla.org/rhino/shell.html have
>  suggested using load, but that seems to be a problem.
>
>  Please advice if there is any other way to reference external js files. If I
>  skip the 'load' line , I get the function undefined error (the hi.js and
>  geturl.js are in the bin directory)

AFAIK, load() is only available to the Rhino shell.

>  Thanks
>  Arjun
>
> --
>  View this message in context: http://www.nabble.com/BSF-Sampler-Javascript-ReferenceError-tp24211672p24211672.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


Mime
View raw message