Download Free Ebooks using Apache JMeter I have created this Apache JMeter script for avid book readers who rely on free ebooks from PacktPub. PacktPub releases free ebooks every now and then. I thought of automate the downloading process, so that I won’t miss any titles.
Table of Contents
Prerequisites
Before you start using this JMeter script, below are the prerequisites:
- Valid account with PacktPub
- Latest version of Apache JMeter
- Latest version of Jenkins
Creating an account with PacktPub
You can create a valid account with PacktPub in here. All you need is valid email account, preferably with google mail.
Latest version of Apache JMeter
You need to have latest version of Apache JMeter in your system. The version I used is Apache JMeter 3.1. You can download JMeter in here.
Latest version of Jenkins
I created a Jenkins freestyle project to automate the downloading process. You can download Jenkins in here.
Download Free Ebooks using Apache JMeter Script
After all the prerequisites are done, you are set to download my JMeter script from my GitHub. .
Go to Script folder to download PacktPubDownload_v1.jmx
Your test plan looks like as shown below.
You will have 4 samplers to download the free eBook in PDF format and 1 sampler to trigger email. Before you run the script, make sure that you have valid credentials is configured or not.
Click on 01_Login sampler and enter your email and password as shown below.
Once the email and password is configured. Next step is to configure the email id to be sent. You can set your email in Send Email Controller > Trigger Email as shown below.
Before you execute
Please note that the purpose of the script is only for educational purpose and to save your time. If you are trying to attempt any illegal activities, QAInsights is not responsible.
Make sure that the Number of Threads (users) are always set to 1 as shown in the below.
If you execute the script, you will get an email with the subject line “Today’s Free Book from PacktPub is {Title}” with the PDF attached as shown below.
In my next blog, I will share the details about integrating this JMeter script with Jenkins, so that you can schedule daily build jobs to receive free eBooks daily without manually logging in and downloading it from PacktPub.
You turn : Please download this script and let me know if you are facing any issues or not. If you want to enhance this, create a pull request in GitHub.
Hi Naveen,
Can’t we create the Load Runner script to download the free books?
Regards
Chida
Yes. WE can create :)