jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lenin Basheer <Len...@ibsplc.com>
Subject Re: _javaScript() function in Jmeter
Date Wed, 30 May 2007 11:50:10 GMT
Hi Sebb,

My objective in short is this.
flightdate =1;
while( flightnumber <10)
{
        list flight for (flightnumber, flightdate);
        if (flghtnumber == 10){
                flightdate++; 
        }
// increment filght date  if value is 10 else retain the same value for 
flight date .. 
 
flightnumber ++;
}

This way i want to achive a unique pattern of flights on all dates ... say 
f1 on Jan 1,  f2 on Jan 1 etc f10 in 1 and then it creates the set f1 on 
Jan 2 , f2 on jan 2 etc.

i cant have two counters because it creates the pattern  f1 on 1 , f2 on 2 
etc.

please help.

regards,
Lenin



sebb <sebbaz@gmail.com> 
05/30/2007 04:45 PM
Please respond to
"JMeter Users List" <jmeter-user@jakarta.apache.org>


To
"JMeter Users List" <jmeter-user@jakarta.apache.org>
cc

Subject
Re: _javaScript() function in Jmeter






On 30/05/07, Lenin Basheer <LeninB@ibsplc.com> wrote:
>
> Hi All,
>
> I ve been tryintg to get the javaScript() to work with jmeter for a 
specfic
> scenario that i am testing. I havent been succesfull and there fore 
seeking
> ur help.

What are you trying to achieve?

> This is the java script that i wrote ;
>
> ${__javaScript(${flightNumber}==10 ? ${i} += 1; : ${i}
> ,flightDate )}

Assuming flightNumber = 7 and i = 3 then the script:

   ${flightNumber}==10 ? ${i} += 1; : ${i}

becomes:

  7==10 ? 3 += 1;: 3

which is not valid.

Variable references are replaced by their values.

> I have the javaScript as a user parameter , with
> name : date
> value : ${__javaScript(${flightNumber}==10 ? ${i} += 1; :
> ${i} ,flightDate )}
>
> However i cant get it value ${i} to increment.
>
> Another option that i tried was to increment the value using a
> _counter(FALSE,flightDate)  with in an if controller that checks if
> flightnumber = 10.
> However the variable flight date goes null outside the scope of the if
> controller.

Initialise it outside the If Controller.

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







DISCLAIMER: 

"The information in this e-mail and any attachment is intended only for 
the person to whom it is addressed and may contain confidential and/or 
privileged material. If you have received this e-mail in error, kindly 
contact the sender and destroy all copies of the original communication. 
IBS makes no warranty, express or implied, nor guarantees the accuracy, 
adequacy or completeness of the information contained in this email or any 
attachment and is not liable for any errors, defects, omissions, viruses 
or for resultant loss or damage, if any, direct or indirect."





Mime
View raw message