Before building performance test plans, you need to set up a robust environment. This guide will walk you through the installation of Java, Apache JMeter, Python, Git, and Chrome/Firefox, as well as configuring proxy and SSL certificates on both Windows and Ubuntu.
Prerequisites
Requirement | Ubuntu (Linux) | Windows |
---|---|---|
OS | Ubuntu 20.04+ | Windows 10/11 |
Internet | Required | Required |
Permissions | sudo user | Admin privileges |
Terminal Access | Terminal | PowerShell or CMD |
Step-by-Step Installation
1. Install Java JDK 17
Ubuntu Terminal Command | Windows Instructions |
---|---|
sudo apt install openjdk-17-jdk -y | Download from Adoptium, install it |
java -version | Confirm via java -version in Command Prompt |
echo 'export JAVA_HOME=...' >> ~/.bashrc | Set JAVA_HOME via System Properties → Environment Variables |
2. Install Apache JMeter (v5.6.3)
Ubuntu | Windows |
---|---|
wget https://downloads.apache.org//jmeter/binaries/apache-jmeter-5.6.3.tgz | Download the zip file from JMeter site |
tar -xvzf apache-jmeter-5.6.3.tgz && sudo mv apache-jmeter-5.6.3 /opt/jmeter | Extract to C:\JMeter\apache-jmeter-5.6.3 |
Add to PATH in .bashrc | Add C:\JMeter\apache-jmeter-5.6.3\bin to Environment Variables → PATH |
Run with jmeter | Run jmeter.bat from the bin folder |
3. Install Google Chrome & ChromeDriver
Ubuntu | Windows |
---|---|
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | Download Chrome from google.com/chrome |
sudo apt install ./google-chrome*.deb | Install Chrome like any other EXE |
Download matching ChromeDriver manually or via script | Download ChromeDriver from here |
Move ChromeDriver to /usr/local/bin | Unzip and place chromedriver.exe in C:\Tools or add to PATH |
4. Install Python 3 and pip
Ubuntu | Windows |
---|---|
sudo apt install python3 python3-pip -y | Download from python.org, and check “Add to PATH” during installation |
python3 --version , pip3 --version | Use python --version and pip --version in CMD |
5. Install Git
Ubuntu | Windows |
---|---|
sudo apt install git -y | Download and install from git-scm.com |
6. Install Firefox & Set Proxy for Recording
Ubuntu | Windows |
---|---|
sudo apt install firefox -y | Download from mozilla.org |
Open Firefox > Settings > Network Settings | Same path: Firefox > Settings > Network Settings |
Manual Proxy: localhost:8888 | Manual Proxy: localhost:8888 |
Check “Use for all protocols” | Same checkbox |
7. Configure JMeter Proxy & SSL CertificateWorks identically on both platforms:
- Launch JMeter GUI
- Go to Templates → Recording → Create
- Start HTTP(S) Test Script Recorder
- JMeter creates a file:
ApacheJMeterTemporaryRootCA.crt
inbin/
- Open Firefox → Settings → Privacy & Security → Certificates
- Click View Certificates → Authorities → Import
- Select
ApacheJMeterTemporaryRootCA.crt
and trust it
Now Firefox will work with JMeter’s HTTPS proxy.
Final Test
To verify everything:
- Open JMeter and start recording
- Set the browser proxy to
localhost:8888
- Visit a website like
https://example.com
- Traffic should appear in JMeter if the certificate is trusted
Optional Script for Ubuntu
Create setup_performance_env.sh
and paste this:
#!/bin/bash
sudo apt update && sudo apt install openjdk-17-jdk wget unzip git python3 python3-pip firefox -y
echo 'export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64' >> ~/.bashrc
wget https://downloads.apache.org/jmeter/binaries/apache-jmeter-5.6.3.tgz
tar -xvzf apache-jmeter-5.6.3.tgz
sudo mv apache-jmeter-5.6.3 /opt/jmeter
echo 'export JMETER_HOME=/opt/jmeter' >> ~/.bashrc
echo 'export PATH=$PATH:$JMETER_HOME/bin' >> ~/.bashrc
source ~/.bashrc
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb -y
CHROME_VERSION=$(google-chrome --version | grep -oP '\\d+\\.\\d+\\.\\d+')
CHROMEDRIVER_VERSION=$(curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_VERSION")
wget https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
sudo mv chromedriver /usr/local/bin/
sudo chmod +x /usr/local/bin/chromedriver
Run:
chmod +x setup_performance_env.sh ./setup_performance_env.sh
Download Links
What’s the biggest challenge you foresee in managing performance test environments across both Windows and Linux?
Think about permission handling, scripting automation, and environment variable management.
Here’s a PowerShell script for Windows that sets up a basic performance test environment, including:
- Installing JDK 17
- Downloading and extracting Apache JMeter
- Downloading Chrome and ChromeDriver
- Installing Python and Git
✅ Note: Some steps still require manual confirmation (e.g., Firefox proxy, SSL cert import). But this script automates everything else to the extent permitted by Windows.
PowerShell Script: Setup-PerformanceEnv.ps1
(for Windows 10/11)
# PowerShell script to install JDK, JMeter, ChromeDriver, Git, and Python
$ErrorActionPreference = "Stop"
# Set base folder
$baseDir = "$env:USERPROFILE\PerformanceTools"
New-Item -ItemType Directory -Force -Path $baseDir | Out-Null
Set-Location $baseDir
Write-Host "🔧 Installing performance testing tools to $baseDir"
# ---- 1. Install JDK 17 ----
Write-Host "📦 Downloading JDK 17..."
$jdkUrl = "https://github.com/adoptium/temurin17-binaries/releases/latest/download/OpenJDK17U-jdk_x64_windows_hotspot_17_latest.msi"
$jdkInstaller = "$baseDir\jdk17.msi"
Invoke-WebRequest -Uri $jdkUrl -OutFile $jdkInstaller
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i `"$jdkInstaller`" /quiet" -Wait
# Set JAVA_HOME and update PATH
$jdkHome = "C:\Program Files\Eclipse Adoptium\jdk-17"
[System.Environment]::SetEnvironmentVariable("JAVA_HOME", $jdkHome, "Machine")
$env:Path += ";$jdkHome\bin"
[System.Environment]::SetEnvironmentVariable("Path", $env:Path, "Machine")
# ---- 2. Install Apache JMeter ----
Write-Host "📦 Downloading Apache JMeter..."
$jmeterUrl = "https://downloads.apache.org//jmeter/binaries/apache-jmeter-5.6.3.zip"
$jmeterZip = "$baseDir\apache-jmeter.zip"
$jmeterDir = "$baseDir\apache-jmeter-5.6.3"
Invoke-WebRequest -Uri $jmeterUrl -OutFile $jmeterZip
Expand-Archive -Path $jmeterZip -DestinationPath $baseDir -Force
[System.Environment]::SetEnvironmentVariable("JMETER_HOME", $jmeterDir, "Machine")
[System.Environment]::SetEnvironmentVariable("Path", "$env:Path;$jmeterDir\bin", "Machine")
# ---- 3. Install Chrome & ChromeDriver ----
Write-Host "🌐 Downloading Chrome..."
Start-Process -FilePath "msedge.exe" -ArgumentList "https://www.google.com/chrome/" -Wait
Write-Host "⬇️ Downloading ChromeDriver..."
$chromeVersion = (Invoke-WebRequest "https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json").Content | ConvertFrom-Json
$driverUrl = $chromeVersion.channels.Stable.downloads.chromedriver | Where-Object {$_.platform -eq "win64"} | Select-Object -ExpandProperty url
$driverZip = "$baseDir\chromedriver.zip"
Invoke-WebRequest -Uri $driverUrl -OutFile $driverZip
Expand-Archive -Path $driverZip -DestinationPath "$baseDir\chromedriver" -Force
$driverExe = Get-ChildItem -Path "$baseDir\chromedriver" -Recurse -Filter chromedriver.exe | Select-Object -First 1
Copy-Item $driverExe.FullName -Destination "C:\Windows\System32"
# ---- 4. Install Python ----
Write-Host "🐍 Installing Python..."
$pythonUrl = "https://www.python.org/ftp/python/3.12.2/python-3.12.2-amd64.exe"
$pythonInstaller = "$baseDir\python-installer.exe"
Invoke-WebRequest -Uri $pythonUrl -OutFile $pythonInstaller
Start-Process -FilePath $pythonInstaller -ArgumentList "/quiet InstallAllUsers=1 PrependPath=1" -Wait
# ---- 5. Install Git ----
Write-Host "🔁 Installing Git..."
$gitUrl = "https://github.com/git-for-windows/git/releases/latest/download/Git-2.44.0-64-bit.exe"
$gitInstaller = "$baseDir\git-installer.exe"
Invoke-WebRequest -Uri $gitUrl -OutFile $gitInstaller
Start-Process -FilePath $gitInstaller -ArgumentList "/VERYSILENT" -Wait
# ---- 6. Firefox Manual Instructions ----
Write-Host "`n🌐 Download Firefox manually from: https://www.mozilla.org/en-US/firefox/new/"
Write-Host "📌 After installing Firefox:"
Write-Host "- Set Manual Proxy: localhost:8888"
Write-Host "- Import JMeter certificate: ApacheJMeterTemporaryRootCA.crt (generated after running recorder)"
Write-Host "`n✅ Environment setup complete. Please restart your machine or open a new PowerShell window."
How to Run This Script on Windows
- Open PowerShell as Administrator
- Allow script execution temporarily:
Set-ExecutionPolicy RemoteSigned -Scope Process
- Save the script as
Setup-PerformanceEnv.ps1
and run:
.\Setup-PerformanceEnv.ps1
What This Script Doesn’t Do (Manual Steps Required):
- Set Firefox proxy settings (must be done via Firefox GUI)
- Trust the JMeter certificate in Firefox (
Tools → Settings → Certificates → Authorities → Import
)