jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SanderW <san...@performancearchitecten.nl>
Subject Re: Write variables to a file without showing them in Results Tree
Date Tue, 14 Sep 2010 12:39:33 GMT


sebb-2-2 wrote:
> 
> That's because there was no sampler under the ForEach Controller.
> JMeter only runs Pre- and Post-Processors, Timers, Listeners etc. if
> there is a sampler to which they can be applied.
> 

Okay, that's clear


sebb-2-2 wrote:
> 
> Note: you don't need a ForEach Controller with BeanShell - just loop
> around the variables in the code.
> 

I replaced the ForEach Controller with BeanShell PostProcessor

While Controller (${__javaScript(("${Inputpagina}" != "<EOF>")? "true" :
"false",)})
...CSV Data Set Config (Variable names = Inputpagina)
...If Controller ("${Inputpagina}" != "<EOF>")
......HTTP Request (path = ${Inputpagina}) 
.........Regular Expression Extractor (Name = Outputpagina & RegEx =
href=\"(.+?)\" & Match No = -1) 
......BeanShell PostProcessor

The BeanShell script is:
int count = Integer.parseInt(vars.get("Outputpagina_matchNr"));

for(int i=1;i<=count;i++) {
	log.info(vars.get("Outputpagina_" + i));
}

I see the lines being logged to the jmeter.log (JMeter version 2.4), but I
also see an error and warning
2010/09/14 14:22:33 ERROR - jmeter.util.BeanShellInterpreter: Error invoking
bsh method: eval	Sourced file: inline evaluation of: ``int count =
Integer.parseInt(vars.get("Outputpagina_matchNr"));  for(int i=1;i<= . . .
'' : Typed variable declaration : Method Invocation Integer.parseInt 
2010/09/14 14:22:33 WARN  - jmeter.extractor.BeanShellPostProcessor: Problem
in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking
bsh method: eval	Sourced file: inline evaluation of: ``int count =
Integer.parseInt(vars.get("Outputpagina_matchNr"));  for(int i=1;i<= . . .
'' : Typed variable declaration : Method Invocation Integer.parseInt 

If the CSV file contains multiple inputpages, only one of the pages is
written to the logfile.
1. What did I do wrong?
2. I'm still looking for a good example of a BeanShell script that let's me
write to a new file instead of the jmeter.log
-- 
View this message in context: http://jmeter.512774.n5.nabble.com/Write-variables-to-a-file-without-showing-them-in-Results-Tree-tp2837757p2839070.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


Mime
View raw message