In this blog post, we will see about how to generate traffic using Access Log Sampler in Jmeter. It is not possible for every performance test engineer to generate traffic for all requests which is similar to production server. Access Log samplers in Jmeter helps test engineers to generate traffic exactly as in production.
- BEA Weblogic – http://e-docs.bea.com/wls/docs70/adminguide/web_server.html#113868
- Tomcat – http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/valve.html
- Websphere – http://e-docs.bea.com/wls/docs61/adminguide/web_server.html#113868
- Resin – http://www.caucho.com/resin-3.0/config/log.xtp#access-log
Now we will see how to generate traffic using Access Log Sampler in Jmeter and how to collect all the requests using Xenu’s Link Sleuth tool.
Steps to find broken links and export the log
- Install Link Sleuth from above link and launch Xenu.
- Click on File > Check URL
- Enter the website that you want to find broken links as shown below
- Click on OK
- Xenu will track all the links in the URL you specified. Once Xenu completed its tracking, you could all the requests in GREEN color as shown below. In the status bar you could check the status of the URLs tracked.
Now go to File > Export Page mode to TAB separated file… to export the result as extended log format. It will look like as shown below, if you open using Notepad++
- Remove the first line i.e. “OriginPage LinkToPage LinkToPageStatus LinkToPageTitle OriginPageDate OriginPageTitle” in the text file.
- Now press Ctrl + H, to replace all HTTP requests format to GET format. Enter “http://<your website.com>” in Find what text box and enter “GET “ (please include double quotes and the space as well) and click on Replace All.
- Now your log file will look as shown below.
Now we will see how to use access log sampler in Jmeter to generate traffic as similar to the production log.
- Launch Apache Jmeter, right click on Test Plan > Add > Threads (Users) > Thread Group
- Right click on Thread Group > Add > Logic Controller > Loop Controller to add Loop controller and check Loop Forever check box
- Right click on Loop Controller > Add > Sampler > Access Log Sampler to add Access Log sampler
- Right click on Thread Group > Add > Listener > View Results Tree to add listeners to monitor the execution.
- Click on Access Log Sampler and enter following details.
- Server i.e. your website name
- Parse Images
- Log file location
- Click on Run and monitor the execution using Listener as shown below.
PS: Click on stop to halt your execution.
Subscribe to our QAInsights YouTube Channel.