Website Stress Testing Tool - Enhanced Edition
A professional stress testing application that simulates realistic traffic patterns to test production websites with support for 1-5000 concurrent users. Now with Website Crawler for realistic user simulation!
🚀 Features
Core Testing
- Concurrent Users: Simulate 1-5000 users simultaneously
- Traffic Patterns: Steady, Burst, Ramp-Up, and Random patterns
- 🕷️ Website Crawler: NEW! Randomly navigate through website links like real users
- Real-Time Monitoring: Live statistics and interactive charts
- CORS Proxy: Bypass browser CORS restrictions with user agent rotation
Advanced Metrics
- Percentile Analysis: P50, P95, and P99 response times
- Error Categorization: Track 4xx, 5xx, timeout, and network errors separately
- Bandwidth Tracking: Monitor total data sent and received
- Request History: Live log of last 100 requests with filtering
User Experience
- 🌓 Theme Toggle: Switch between dark and light modes
- ⚡ Test Presets: Quick-load configurations (Light, Medium, Heavy, Spike)
- 💾 Save Configurations: Save and reload custom test setups
- ⌨️ Keyboard Shortcuts: S=Start, P=Pause, X=Stop
- 📱 Mobile Responsive: Works great on all devices
- Export Results: JSON and CSV export functionality
Premium UI
- Modern dark/light theme with glassmorphism effects
- Real-time charts with Chart.js
- Smooth animations and transitions
- Professional color-coded statistics
📋 Prerequisites
- Node.js (v14 or higher) - Required for the CORS proxy server
- Modern Web Browser (Chrome, Firefox, Edge, Safari)
🛠️ Setup Instructions
Step 1: Install Node.js
If you don't have Node.js installed:
Windows:
# Using Chocolatey
choco install nodejs
# Or download from: https://nodejs.org/
macOS:
# Using Homebrew
brew install node
Linux:
# Ubuntu/Debian
sudo apt install nodejs npm
# Fedora
sudo dnf install nodejs
Step 2: Start the CORS Proxy Server
The proxy server is required to bypass CORS restrictions when testing production websites.
# Navigate to the project directory
cd "C:\Users\DM\OneDrive - BCT\BCT-YT - Documents\Project-Files\HomeLoan\HTML\StressTest"
# Start the proxy server
node proxy-server.js
You should see:
╔════════════════════════════════════════════════════════════╗
║ CORS Proxy Server for Stress Testing Tool ║
╚════════════════════════════════════════════════════════════╝
✅ Server running on: http://localhost:3000
✅ Max connections: 5000
✅ Request timeout: 30000ms
Keep this terminal window open while using the stress testing tool.
Step 3: Open the Stress Testing Tool
Open index.html in your web browser:
Option A: Double-click the index.html file
Option B: Use a local web server (recommended)
# In a NEW terminal window (keep proxy running in the first)
python -m http.server 8080
# Then open: http://localhost:8080
📖 Usage Guide
Quick Start with Presets
- Select a Preset: Choose from Light, Medium, Heavy, or Spike test
- Enter Target URL:
https://example.com - Click "Start Test": Watch real-time metrics
- Review Results: Scroll down after test completes
Basic Test
- Enter Target URL:
https://beyondcloud.solutions/tag/guides/ - Set Concurrent Users: Use the slider (1-5000)
- Set Duration: Test duration in seconds (10-600)
- Select Traffic Pattern:
- Steady: Constant requests per second
- Burst: Traffic spikes at intervals
- Ramp-Up: Gradual increase in load
- Random: Realistic user behavior
- Click "Start Test"
- Monitor Live Statistics: Watch real-time metrics and charts
- Stop or Wait: Click "Stop" or let it complete
- Review Results: Scroll down to see detailed metrics
- Export (optional): Download results as JSON or CSV
🕷️ Crawler Mode (NEW!)
Simulate real users by randomly navigating through website links:
- Enable Crawler Mode: Check the "Enable Crawler Mode" checkbox
- Set Crawl Depth: How many page hops per user (1-5)
- Set Links Per Page: Maximum links to extract (1-50)
- Start Test: Users will randomly click links and navigate the site
- Monitor: Watch the Request History to see different URLs being visited
How it works:
- Extracts links from HTML responses
- Randomly selects links from the same domain
- Simulates realistic browsing behavior
- Tracks unique URLs visited
Advanced Options
Click "Advanced Options" to configure:
- HTTP Method: GET, POST, PUT, DELETE, PATCH
- Custom Headers: Add authentication, content-type, etc.
{ "Authorization": "Bearer your-token", "Content-Type": "application/json" } - Request Body: For POST/PUT requests
{ "key": "value" } - Think Time: Delay between requests (0-5000ms)
Keyboard Shortcuts
- S: Start test
- P: Pause/Resume test
- X: Stop test
Theme Toggle
Click the 🌓 Theme button in the header to switch between dark and light modes. Your preference is saved automatically.
Save & Load Configurations
- Configure your test with desired settings
- Click "💾 Save Current Config"
- Enter a name for your configuration
- Reload page to see it in the presets dropdown
- Select saved config to quickly load those settings
📊 Understanding Results
Key Metrics
- Total Requests: Number of HTTP requests sent
- Success Rate: Percentage of successful responses (2xx, 3xx)
- Requests per Second (RPS): Average throughput
- Response Time: Min, Max, Average, P50, P95, P99
- Failed Requests: Number of errors or timeouts
- Bandwidth: Total data sent and received
Percentiles (NEW!)
- P50 (Median): 50% of requests were faster than this
- P95: 95% of requests were faster than this (good for SLAs)
- P99: 99% of requests were faster than this (catches outliers)
Error Breakdown (NEW!)
- 4xx Errors: Client errors (bad request, not found, etc.)
- 5xx Errors: Server errors (internal server error, etc.)
- Timeout Errors: Requests that exceeded timeout limit
- Network Errors: Connection failures, DNS errors, etc.
Charts
- RPS Chart: Shows request rate over time
- Response Time Chart: Shows latency trends
- User Load vs Error Rate: Correlates user count with error percentage
Request History (NEW!)
- Live table showing last 100 requests
- Color-coded by success/failure
- Shows URL, status code, and response time
- Auto-scrolls with new requests
🔧 Configuration
Changing the Proxy URL
If you deploy the proxy server to a different location, update the proxy URL in script.js:
this.config = {
// ... other config
proxyUrl: 'http://your-server:3000' // Change this
};
Deploying to Production
When hosting on a web server:
-
Update proxy server
allowedOriginsinproxy-server.js:const CONFIG = { allowedOrigins: 'https://your-domain.com', // Not '*' }; -
Deploy both files:
- Frontend:
index.html,styles.css,script.js - Backend:
proxy-server.js,package.json
- Frontend:
-
Run proxy server on your hosting:
npm start # or node proxy-server.js
🎯 Testing Your Website
Example: Testing with Crawler Mode
- Start proxy server:
node proxy-server.js - Open
index.htmlin browser - Enter URL:
https://beyondcloud.solutions - Enable Crawler Mode ✅
- Set crawl depth: 2
- Set users: 50
- Set duration: 60 seconds
- Select pattern: Random
- Click "Start Test"
- Watch Request History to see different pages being visited
- Monitor results
⚠️ Important Notes
Browser Limitations
- This tool runs in the browser, which has connection limits
- For very high loads (1000+ users), consider server-side tools:
- Apache JMeter
- k6
- Artillery
- Gatling
CORS Proxy Security
- Development: The proxy allows all origins (
*) - Production: Update
allowedOriginsto your specific domain - Never expose an open proxy to the internet
Responsible Testing
- Only test websites you own or have permission to test
- Start with low user counts to avoid overwhelming servers
- Monitor your target server during tests
- Be aware that aggressive testing may trigger rate limiting or security measures
- Crawler mode generates more requests - use responsibly
🐛 Troubleshooting
"All requests are failing"
Problem: CORS proxy not running
Solution: Start the proxy server:
node proxy-server.js
"Connection refused" errors
Problem: Proxy server not accessible
Solutions:
- Check proxy is running on port 3000
- Verify firewall isn't blocking port 3000
- Check
proxyUrlinscript.jsmatches your setup
"Request timeout" errors
Problem: Target server is slow or unreachable
Solutions:
- Increase timeout in
proxy-server.js(line 16) - Reduce concurrent users
- Increase think time
- Check target URL is accessible
Crawler not finding links
Problem: Website uses JavaScript to render links
Solutions:
- Crawler only works with server-rendered HTML
- Try disabling crawler mode for JavaScript-heavy sites
- Consider using headless browser tools for SPA testing
📁 File Structure
StressTest/
├── index.html # Main application UI (enhanced)
├── styles.css # Premium design system (dark/light theme)
├── script.js # Frontend logic (with crawler)
├── proxy-server.js # CORS proxy backend (enhanced)
├── package.json # Node.js configuration
└── README.md # This file
🆕 What's New in Enhanced Edition
Version 2.0 Features
✨ Website Crawler: Simulate real user navigation 📊 Percentile Metrics: P50, P95, P99 response times 🔍 Error Categorization: Detailed error breakdown 📈 Bandwidth Tracking: Monitor data usage 📝 Request History: Live log of recent requests ⚡ Test Presets: Quick-load common scenarios 💾 Save Configurations: Persist custom setups 🌓 Theme Toggle: Dark and light modes ⌨️ Keyboard Shortcuts: Quick controls 🎨 Enhanced UI: Improved mobile responsiveness 🔄 User Agent Rotation: More realistic traffic simulation
🔒 Security Considerations
- Proxy Server: Restrict
allowedOriginsin production - Rate Limiting: Consider adding rate limits to the proxy
- Authentication: Add auth if exposing publicly
- Monitoring: Log requests for security auditing
- Crawler Mode: Be mindful of the additional load it generates
📝 License
MIT License - Feel free to modify and use as needed.
🤝 Support
For issues or questions:
- Check this README
- Review the browser console for errors
- Check proxy server logs
- Verify target website is accessible
Happy Stress Testing! 🚀
Enhanced with Website Crawler & Advanced Metrics