On 30 August 2012 15:44, Morten Christensen (appinux)
<[email protected]> wrote:
> Hi,
>
> I am trying to extend JMeter with a custom login procedure that I have 
> created using Http Client in a JavaSamplerClient. The custom login code 
> creates 6 cookies on various domains and I want to add them to the JMeter's 
> HTTP Cookie Manager that I have added to the Thread Group in my test plan in 
> JMeter, so that subsequent HTTP REQUEST samplers will use them.

It's not clear why the existing HTTP Sampler cannot be used.

> My problem is that I can't access the instance of the HTTP Cookie Manager 
> that JMeter is using and can't find any documentation about what to do.

The CM is only made available to the HTTP Samplers.

But you may find that variable references in the CM will pick up
cookies stored as variables by the login code.

> The provided JavaSamplerContext does not have anything of interest and nor 
> does the JMeterContextService. I have also tried to cast the value of 
> JMeterContextService.getContext().meterContext.getCurrentSampler().getProperty("HTTPSampler.cookie_manager")
>  used by a source file I saw for the HTTP request but unfortunately this also 
> did not work (returns null).
>
> Any help will be much appreciated ? Alternatively, if it is impossible to 
> create a simple JavaSamplerClient for custom cookie login, what is the 
> recommended way?

What is it that the custom JavaSamplerClient does that the HTTP
Sampler does not?

> --
> Morten Christensen (appinux)
> Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
>

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

Reply via email to