HTTP requests and HeaderManager
Could be way off target here, as I'm a bit of a newbie. I have a custom java sampler that uses a HeaderManager to manage headers in multiple requests. My sampler makes a number of http requests in a single sample to form part of a dynamic 'transaction' and this means that different requests may need different headers, e.g. some could be GET, some POST, some require CSRF headers etc. I'm using an HTTPSamplerBase implementation and it appears there's no distinction between a default header and a request header that just applies to the request to be sent, could be wrong, but I can't see any way to separate the two in the API. My solution is to manage default and request headers is a wrapper class that will remove headers after the request is made, so they do not pollute subsequent requests. However, from my basic reading of the code, the header manager is using an ArrayList to store headers and to remove a header, it has to iterate that list. Is there any reason why it would not be more sensible to use a LinkedHashSet. Slightly additional overhead in storage, but much faster in removing elements. Cheers
Finding CookieManager from within test sampler
I have a test where I have a CookieManager assigned to a thread group. I have written a custom JavaSamplerClient where I am using the HTTPSamplerFactor to create a HTTPSamplerBase object within that java client - I use it to manage multiple requests, hence rolling my own. I can add a new CookieManager instance to that sampler and have that working fine, but what I want to do is to get the CM that has been assigned to the TG, but I can't find it. If I get the AbstractThreadGroup, I have traversed the TG and have the following test elements in a thread group Start:testElement=Ajax_1" Start:property=TestElement.gui_class(org.apache.jmeter.threads.gui.ThreadGroupGui)" Start:property=TestElement.test_class(org.apache.jmeter.threads.ThreadGroup)" Start:property=TestElement.name(Ajax_1)" Start:property=TestElement.enabled(true)" Start:property=ThreadGroup.on_sample_error(continue)" Start:property=ThreadGroup.main_controller(org.apache.jmeter.control.LoopController@27f9f8f5)" Start:testElement=Loop Controller" Start:property=LoopController.continue_forever(false)" Start:property=TestElement.gui_class(org.apache.jmeter.control.gui.LoopControlPanel)" Start:property=TestElement.test_class(org.apache.jmeter.control.LoopController)" Start:property=TestElement.name(Loop Controller)" Start:property=TestElement.enabled(true)" Start:property=LoopController.loops(2)" Start:property=ThreadGroup.num_threads(2)" Start:property=ThreadGroup.ramp_time(1)" Start:property=ThreadGroup.start_time(1482116187000)" Start:property=ThreadGroup.end_time(1482116187000)" Start:property=ThreadGroup.scheduler(false)" Start:property=ThreadGroup.duration()" Start:property=ThreadGroup.delay()" But I have a CM declared for the test and I can't seem to get hold of it from within my sampler. Anyone know how I can get hold of the instance? Antony
Re: Sending Large Bodies & Dynamic URLs?
Hello Alan, When debugging the testplans I'm using most of the times the view result tree: http://jmeter.apache.org/usermanual/component_reference.html#View_Results_Tree With this component you can see the request jmeter send to the server and the anser the server gives back to jmeter. Hope this will help you. Regards, Peter Alan Stebbensschreef op 22 december 2016 22:26:06 CET: >Hello, > >I have a test plan in which I need to submit one of three different >sized >test bodies: small, medium, and large. > >Within a RandomOrder controller, I have three HTTP Request Samplers, to >a >specific endpoint, using HTTPS, each of which has been configured with >a >file (without a parameter name) naming the path to the corresponding >body >of the HTTP request. > >It appears that the HTTP Request Sampler is not submitting the body on >the >POST. I've tried both with and without default parameters (eg: >Accept:, >and Content-Type:). > >Is there a way to log the actual transaction requests and bodies being >generated by JMeter? > >Thanks > >-- > >*Alan* -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
Sending Large Bodies & Dynamic URLs?
Hello, I have a test plan in which I need to submit one of three different sized test bodies: small, medium, and large. Within a RandomOrder controller, I have three HTTP Request Samplers, to a specific endpoint, using HTTPS, each of which has been configured with a file (without a parameter name) naming the path to the corresponding body of the HTTP request. It appears that the HTTP Request Sampler is not submitting the body on the POST. I've tried both with and without default parameters (eg: Accept:, and Content-Type:). Is there a way to log the actual transaction requests and bodies being generated by JMeter? Thanks -- *Alan*
Re: Jmeter Certificate issue.
Hi, Yes, you can go for badboy or blazemeter. But in my opinion Jmeter inbuilt proxy recording is the best with abilities to save the recording.xml. I have done loadtesting for salesforce crm. There, I had to do atleast 100+ correlations for a complete business scenario and so on. On those kind of cases you will feel lost with badboy or blazemeter. On Dec 22, 2016 4:27 PM, "sachin Dhote"wrote: Record scripts with blazemeter plugin or badboy software and then run these scripts in jmeter On Dec 21, 2016 5:14 PM, "Anil Gaur" wrote: > > Hi > > > I am trying to record the script for Angular JS based application. but I > ma not able to record any single script because of certificate issue on IE > and Chrome. And Firefox its not recording the script without any > certificate error. > > > Fir certificate issue i have already imported certificate from bin folder > using following steps:- > > Steps are as follw > 1)Start your jmeter recorder. > 2)try to open your website . > 3)go to j meter bin folder you wil find .crt file generated over there. > 4)add that certificate file into browser (normal browser certificate > installation) > 5) restart browser and jmeter recorder and try recording > > > but again its not working.Now I am blank and not got any single solution > to resolve this issue. > > So please help me how to over come from this problem. > > > Jmeter Version:-2.13 r1665067 > > IE Version:-11.0.9600.17843 > > Chrome Version:-Version 55.0.2883.87 m (64-bit) > > > > Thanks & Regards' > > Anil Gaur >
Re: Jmeter Certificate issue.
Record scripts with blazemeter plugin or badboy software and then run these scripts in jmeter On Dec 21, 2016 5:14 PM, "Anil Gaur"wrote: > > Hi > > > I am trying to record the script for Angular JS based application. but I > ma not able to record any single script because of certificate issue on IE > and Chrome. And Firefox its not recording the script without any > certificate error. > > > Fir certificate issue i have already imported certificate from bin folder > using following steps:- > > Steps are as follw > 1)Start your jmeter recorder. > 2)try to open your website . > 3)go to j meter bin folder you wil find .crt file generated over there. > 4)add that certificate file into browser (normal browser certificate > installation) > 5) restart browser and jmeter recorder and try recording > > > but again its not working.Now I am blank and not got any single solution > to resolve this issue. > > So please help me how to over come from this problem. > > > Jmeter Version:-2.13 r1665067 > > IE Version:-11.0.9600.17843 > > Chrome Version:-Version 55.0.2883.87 m (64-bit) > > > > Thanks & Regards' > > Anil Gaur >