On 16 June 2013 17:47, Drach, Noa <[email protected]> wrote:
> Thanks,
> It looks like using beanshell.preprocessor.init is the direction for what I 
> was looking for.
>
> I have one more question as a result:
> If I put the preprocessor as a child of an http request everything works OK, 
> but if I try to put the preprocessor as a sibling of the sampler or as a 
> sibling of the HTTP Header Manager I manage to get the results from my 
> functions(I verified that the requests are sent with different values in the 
> headers) and at the same time I get in each invocation:
>
> ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval     
>   Sourced file: inline evaluation of: 
> ``getTenant(Integer.parseInt(vars.get("NUM_OF_TENANTS"))); getPersonId(50);   
>      . . . '' : Typed variable declaration : Error in method invocation: 
> Method getHeaderManager() not found in 
> class'org.apache.jmeter.sampler.TestAction'
> WARN  - jmeter.modifiers.BeanShellPreProcessor: Problem in BeanShell script 
> org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval    
> Sourced file: inline evaluation of: 
> ``getTenant(Integer.parseInt(vars.get("NUM_OF_TENANTS"))); getPersonId(50);   
>      . . . '' : Typed variable declaration : Error in method invocation: 
> Method getHeaderManager() not found in 
> class'org.apache.jmeter.sampler.TestAction'
>
> This structure gets the results correctly without errors and warnings:
> Test Plan
>         HTTP Header Manager
>         My Thread group
>                 HTTP Request Sampler
>                         Bean shell preprocessor
>
> This structure produces errors while getting the results correctly:
> Test Plan
>         HTTP Header Manager
>         My Thread group
>                 Bean shell preprocessor
>                 HTTP Request Sampler

Are there any other samplers in scope?
The error message suggests that there is a TestAction somewhere. That
does not have a Header Manager.
Your script will need to check the sampler type first.

> Thanks,
> Noa
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to