Hi All

  I am using jmeter for functional testing . I have scenario in which i have
to auto genarate the values , for this i have java script and the result i
get from javascript should be passed to the http request.

Using BSF or BSE preprocessors can we do it.

I don't know how to place and where to place my code in the preprocessors
and   assign the result obtained using this  preprocessors in my request.

here is my code in java script .

function randomString() {
 var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ";
 var string_length = 2;
 var randomstring = '';
 for (var i=0; i<string_length; i++) {
  var rnum = Math.floor(Math.random() * chars.length);
  randomstring += chars.substring(rnum,rnum+1);
 }
 document.randform.randomfield.value = randomstring;
}

my test plan is

thread group
http request ( variable in both http request and preprocessor is defined
same)
BSF or BSE preprocessor
view results tree.

can  anyoneassist me  how to do this and  any detailed procedure is much
appreciated

rgds
Sudheer

Reply via email to