A comprehensive Docker-based Chrome 97 testing environment that allows you to test your web applications in an older Chrome version. Perfect for compatibility testing, legacy browser support validation, and ensuring your applications work across different Chrome versions.
- 🐳 Dockerized Chrome 97: Isolated Chrome 97 environment using Selenium
- 🖥️ Visual Access: noVNC desktop for real-time browser interaction
- 🔗 Localhost Access: Seamless connection to your local development servers
- ⚡ Multiple Connection Modes: Quick connect, timed sessions, and infinite runtime
- 🛠️ Developer Tools: Built-in connectivity testing and debugging utilities
- 📱 Multi-Port Support: Connect to any local port (3000, 4200, 5173, 8080, etc.)
- 🔄 Auto-Recovery: Bulletproof session management with automatic reconnection
- Docker and Docker Compose installed
- Your web application running locally
- Node.js (for JavaScript tests) or Python 3.7+ (for Python tests)
# Clone the repository
git clone https://github.com/morbargig/chrome-97-simulator.git
cd chrome-97-simulator
# Start the Chrome 97 container
docker-compose up -d
# Verify it's running
docker-compose ps
# Connect to your frontend (will prompt for port)
python3 connect_to_frontend.py
# Or specify port directly
python3 connect_to_frontend.py 3000
# Install dependencies
npm install
# Connect to different ports
npm run connect:3000 # React, Next.js
npm run connect:4200 # Angular
npm run connect:5173 # Vite
npm run connect:8080 # Vue.js
# Run forever with auto-recovery
python3 run_forever.py 3000
- 🖥️ Visual Desktop: http://localhost:7900 (no password required)
- 🔧 WebDriver API: http://localhost:4444
- 📊 Container Status:
docker-compose ps
Script | Description | Usage |
---|---|---|
connect_to_frontend.py |
Interactive connection to your app | python3 connect_to_frontend.py [port] |
run_forever.py |
Infinite session with auto-recovery | python3 run_forever.py [port] |
connect_24hours.py |
24-hour continuous session | python3 connect_24hours.py [port] |
connect_2hours.py |
2-hour timed session | python3 connect_2hours.py [port] |
selenium_test.py |
Basic Selenium functionality test | python3 selenium_test.py |
test_connectivity.py |
Test connection to localhost | python3 test_connectivity.py |
test_server.py |
Simple test server for demos | python3 test_server.py |
npm run start:container # Start Docker container
npm run stop:container # Stop Docker container
npm run logs # View container logs
npm run status # Check container status
npm run test # Run JavaScript Selenium test
npm run test:python # Run Python Selenium test
npm run test:connectivity # Test localhost connectivity
npm run test:curl # Test with curl
The docker-compose.yml
includes optimized settings for Chrome 97:
services:
selenium-chrome:
image: selenium/standalone-chrome:97.0
platform: linux/amd64
ports:
- "4444:4444" # WebDriver
- "7900:7900" # noVNC
environment:
- SE_VNC_NO_PASSWORD=1
- SE_SCREEN_WIDTH=1920
- SE_SCREEN_HEIGHT=1080
extra_hosts:
- "host.docker.internal:host-gateway"
Your development server must be accessible from Docker:
# Next.js
npx next dev -H 0.0.0.0
# Create React App
HOST=0.0.0.0 npm start
# Vite
npm run dev -- --host 0.0.0.0
# Express.js
app.listen(3000, '0.0.0.0', () => {
console.log('Server running on 0.0.0.0:3000');
});
# These bind only to localhost/127.0.0.1
npm start # Default CRA
npx next dev # Default Next.js
npm run dev # Default Vite
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Remote(
command_executor="http://localhost:4444/wd/hub",
options=options
)
driver.get("http://host.docker.internal:3000")
print(f"Page title: {driver.title}")
driver.quit()
- Screenshots: Capture visual state at any point
- Element Interaction: Click, type, scroll, hover
- JavaScript Execution: Run custom scripts in Chrome 97
- Network Monitoring: Check requests and responses
- Performance Testing: Measure load times and rendering
# Check container status
docker-compose ps
# View logs
docker-compose logs selenium-chrome
# Restart container
docker-compose restart selenium-chrome
# Complete reset
docker-compose down && docker-compose up -d
- Can't reach localhost: Ensure your server binds to
0.0.0.0
, not127.0.0.1
- WebDriver not responding: Check if container is running with
docker-compose ps
- noVNC not loading: Wait 30 seconds after starting container
- Port conflicts: Make sure ports 4444 and 7900 are available
# Test connectivity from your Mac
curl -I http://localhost:3000
# Test from inside container
docker exec selenium-chrome-97 curl -I http://host.docker.internal:3000
# Check firewall (macOS)
sudo pfctl -sr | grep 3000
chrome-97-simulator/
├── 🐳 docker-compose.yml # Container configuration
├── 🐍 connect_to_frontend.py # Main connection script
├── ♾️ run_forever.py # Infinite session runner
├── ⏰ connect_24hours.py # 24-hour session
├── ⏰ connect_2hours.py # 2-hour session
├── 🧪 selenium_test.py # Basic Selenium test
├── 🔗 test_connectivity.py # Connection tester
├── 🌐 test_server.py # Simple test server
├── 📜 test_curl.sh # Shell connectivity test
├── 📦 package.json # Node.js dependencies
├── 🐍 requirements.txt # Python dependencies
└── 📖 README.md # This file
- Legacy Browser Support: Test your modern app in Chrome 97
- Regression Testing: Ensure new features don't break in older browsers
- CSS Compatibility: Validate CSS Grid, Flexbox, and modern features
- JavaScript Compatibility: Test ES6+ features and polyfills
# GitHub Actions example
- name: Test in Chrome 97
run: |
docker-compose up -d
python3 selenium_test.py
docker-compose down
- Browser Evolution: Show differences between Chrome versions
- Compatibility Workshops: Hands-on legacy browser testing
- Selenium Training: Learn automation in a controlled environment
python3 connect_to_frontend.py 3000
python3 connect_2hours.py 3000 # 2 hours
python3 connect_24hours.py 3000 # 24 hours
python3 run_forever.py 3000
Features of infinite session:
- ♾️ Runs until manually stopped
- 🔄 Auto-reconnection on failures
- 🐳 Container restart on crashes
- 📊 Regular status reports
- 🛡️ Bulletproof error recovery
options = Options()
options.add_argument('--window-size=1600,1000')
options.add_argument('--disable-web-security')
options.add_argument('--allow-running-insecure-content')
viewports = [
{'width': 375, 'height': 667}, # Mobile
{'width': 768, 'height': 1024}, # Tablet
{'width': 1920, 'height': 1080} # Desktop
]
for viewport in viewports:
driver.set_window_size(viewport['width'], viewport['height'])
# Test your responsive design
# Measure page load time
start_time = time.time()
driver.get("http://host.docker.internal:3000")
load_time = time.time() - start_time
print(f"Page loaded in {load_time:.2f} seconds")
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: This README and inline code comments
- Selenium - Web automation framework
- Docker - Containerization platform
- Chrome 97 - The browser version we're simulating
- noVNC - Browser-based VNC client
⭐ Star this repository if it helps you test your applications in Chrome 97!