jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Bradley <adam_j_brad...@yahoo.com>
Subject Re: Variables - reassigning values to existing variables
Date Tue, 27 Jun 2006 14:18:35 GMT
Adam Bradley wrote:
> Eddie O'Sullivan wrote:
>> If you use a beanshell sampler to update the variable and use a regular
>> expression extractor to extract the updated variable that will work for
>> you.
> 
> Eddie,
> 
> Thanks for that - got that working, but now I have to fight
> 
> ---snip---
>     at java.lang.Thread.run(Unknown Source)
> Caused by: Sourced file: inline evaluation of: ``debug = "True";  if 
> (debug == "True")      log.info("MessageType " + vars.get("M . . . '' : 
> Typed variable declaration : Error in method invocation: No args method 
> getIterator() not found in 
> class'org.apache.jmeter.threads.JMeterVariables' : at Line: 6 : in file: 
> inline evaluation of: ``debug = "True";  if (debug == "True") 
> log.info("MessageType " + vars.get("M . . . '' : vars .getIterator ( )
> 
> ---snip---
> 
> But I know its there!  I've seen the API... :)
> 
> http://jakarta.apache.org/jmeter/api/org/apache/jmeter/threads/JMeterVariables.html 
> 
> 
> Adam

In the immortal works of Napolean Dynamite "freakin' idiot!"  Guess who
forgot to import...

---snip---
import org.apache.jmeter.samplers.SampleResult;
import org.apache.jmeter.threads.JMeterVariables;

SampleResult sr = new SampleResult();

log.info("sr == " + sr.toString());
log.info("sr == " + sr.Class);

vars.put("testVar","surprise!");

Iterator i = vars.getIterator();
while(i.hasNext()) {
   Map.Entry me = i.next();
   if(String.class.equals(me.getValue().getClass()))
     log.info(me.toString());
}
---snip---

Adam






---------------------------------------------------------------------
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