From the course: Advanced JMeter

Setting up the Proxy Server - Apache JMeter Tutorial

From the course: Advanced JMeter

Start my 1-month free trial

Setting up the Proxy Server

- [Instructor] In order to capture traffic between the browser and the server we need to set up a proxy server. The proxy will sit between the browser and the server and monitor all of the traffic between them. It will capture it all and then it will present all of those requests back within JMeter. In order to set this up we need to go over to JMeter, right click on our test plan on the left hand side, go to add, go to non test elements, and then the HTTPS test script recorder. From here we can see a few different options. We can see that the port that our proxy will use will be 8888 by default. The only thing I'll need to change on this screen will be the target controller. If I change it from user recording controller to HTTPS test script recorder that'll allow me to start recording information straight away. The recording controller plays an important part in the JMeter test script recording life cycle. It allows you to record different streams of information into different logical buckets within JMeter. But for this example I just want to capture everything in one place so I'm going to use the main HTTPS test script recorder. Now I'll click the start button. Now this pop up is telling me about the JMeter temporary root CA certificate. Now basically, if I wanted to capture HTTPS traffic, that's secure traffic, I'd need to install that on my local machine. I'm not doing that for this course, so I don't need to. That process can look slightly different between Mac and Windows so if you do want to install that make sure you research how to do that thoroughly. With the proxy server open running on port 8888, I now need to configure my web browser to point at that same port. I'm on a Mac so I would search for network settings, go to my network settings. My wifi connection would already by selected so I'd hop on over to the advanced section. There's a tab there that says proxies. I'd click on that. And I would make sure that the web proxy box is checked. Now this already tells me that the web proxy servers address is already local host, so that's my machine. And the port is 8888. If these two port numbers are different for any reason or if I needed to use a different port number other than 8888 I just needed to make sure that they were consistent between both my browser settings and also JMeter, otherwise this won't work. Now I'm going to click okay. And then I'm going to click apply. Now that that's all saved I can go back to JMeter. I can now go to Google Chrome, and I can visit a known website for this course. So, now that that's loaded, I can now see that this information is already starting to be saved within JMeter. I can expand upon this by going back into JMeter, just moving this record transaction controller out of the way. And seeing the content within the HTTPS test script recorder. Seeing these individual requests sent from my system through the proxy, and therefore through JMeter to the server and back again, I can think of all of this as almost an audit trail from everything that I've sent and received to and from the website. Each of these outgoing and incoming requests have been caught by JMeter's proxy server, and that information has been copied down for my to investigate later.

Contents