- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands - CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround - CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check - NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere - MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates - LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference Co-authored-by: Cursor <cursoragent@cursor.com>
6.5 KiB
UDM Pro Browser Automation - Complete Solution
Last Updated: 2026-01-14
Status: ✅ Ready to Use
Summary
The browser automation framework for UDM Pro static route configuration is complete and ready to use. The framework includes:
- ✅ Full authentication and navigation
- ✅ Comprehensive button detection (50+ strategies)
- ✅ Manual intervention mode (when automatic detection needs help)
- ✅ Automatic form filling and submission
- ✅ Complete error handling and recovery
Quick Start: Two Options
Option 1: Fully Automated (When Button Selector is Known)
cd /home/intlc/projects/proxmox
UNIFI_USERNAME=unifi_api UNIFI_PASSWORD='L@kers2010$$' \
HEADLESS=true \
node scripts/unifi/configure-static-route-playwright.js
Note: This requires the Add button selector to be identified first (see Option 2).
Option 2: Manual Add Button Click (Works Now)
cd /home/intlc/projects/proxmox
./scripts/unifi/run-with-manual-add.sh
Or manually:
cd /home/intlc/projects/proxmox
UNIFI_USERNAME=unifi_api UNIFI_PASSWORD='L@kers2010$$' \
HEADLESS=false PAUSE_MODE=true \
node scripts/unifi/configure-static-route-playwright.js
What happens:
- Script logs in automatically
- Navigates to Static Routes page
- Pauses and waits for you to click the Add button
- Automatically detects when form appears
- Fills form fields automatically
- Clicks Save
- Verifies route was created
Time required: ~30 seconds of your time (just click Add button)
How It Works
Step-by-Step Process
-
Authentication ✅
- Logs in with
unifi_apiaccount - Handles SSL certificate issues
- Verifies successful login
- Logs in with
-
Navigation ✅
- Navigates to
Settings → Routing & Firewall → Static Routes - Waits for page to fully load
- Handles redirects and page state
- Navigates to
-
Add Button Detection ⚠️
- Tries 50+ automatic detection strategies
- If not found, enters manual intervention mode
- Waits up to 120 seconds for manual click
- Automatically detects when form appears
-
Form Filling ✅
- Fills route name: "Route to VLAN 11"
- Fills destination: "192.168.11.0/24"
- Fills gateway: "192.168.11.1"
- Handles all form fields automatically
-
Submission ✅
- Clicks Save button
- Waits for confirmation
- Verifies route was created
-
Verification ✅
- Checks route list for new route
- Confirms route details
- Reports success
Configuration
The script is configured to create:
- Name: Route to VLAN 11
- Destination Network: 192.168.11.0/24
- Gateway: 192.168.11.1
- Distance: 1 (default)
To change these values, edit ROUTE_CONFIG in scripts/unifi/configure-static-route-playwright.js:
const ROUTE_CONFIG = {
name: 'Route to VLAN 11',
destination: '192.168.11.0/24',
gateway: '192.168.11.1',
distance: 1,
};
Environment Variables
UNIFI_UDM_URL: UDM Pro URL (default:https://192.168.0.1)UNIFI_USERNAME: Username (default:unifi_api)UNIFI_PASSWORD: Password (required)UNIFI_BROWSER_USERNAME: Override username for browserUNIFI_BROWSER_PASSWORD: Override password for browserDRY_RUN: Set totrueto test without making changesHEADLESS: Set tofalseto see browser (default:true)PAUSE_MODE: Set totrueto pause for manual intervention
Troubleshooting
Script Can't Find Add Button
Solution: Use manual intervention mode:
HEADLESS=false PAUSE_MODE=true node scripts/unifi/configure-static-route-playwright.js
The script will wait for you to click Add, then continue automatically.
Form Doesn't Appear After Clicking Add
- Check browser console for errors (F12)
- Verify you're on the Static Routes page
- Try refreshing the page
- Check if Add button requires specific permissions
Navigation Fails
- Verify UDM Pro URL is correct
- Check network connectivity
- Verify credentials are correct
- Check if UDM Pro requires different authentication
Form Fields Not Filling
- Check screenshot:
scripts/unifi/screenshots/08-add-route-form.png - Verify form field names haven't changed
- Check browser console for errors
Screenshots
Screenshots are automatically saved to scripts/unifi/screenshots/:
01-login-page.png- Login page02-credentials-filled.png- After filling credentials03-after-login.png- After successful login05-routing-page.png- Routing settings page06-static-routes-page.png- Static Routes page07-before-add-button.png- Before searching for Add button08-add-route-form.png- Route form (when it appears)09-waiting-for-manual-add-click.png- Waiting for manual click10-form-filled.png- After filling form11-route-saved.png- After saving routeerror-state.png- If an error occurs
Tools Available
1. Main Automation Script
File: scripts/unifi/configure-static-route-playwright.js
- Complete automation with manual intervention fallback
2. Visual Page Analyzer
File: scripts/unifi/analyze-page-visually.js
- Interactive tool to identify Add button selector
- Highlights buttons and tests each one
3. Strategy Tester
File: scripts/unifi/test-all-add-button-strategies.js
- Tests all buttons and strategies automatically
- Reports which strategy works
4. Quick Start Script
File: scripts/unifi/run-with-manual-add.sh
- Convenient wrapper for manual intervention mode
Next Steps (Optional)
To Make It Fully Automated
-
Identify Add Button Selector:
node scripts/unifi/analyze-page-visually.js- Test buttons interactively
- Note the selector when form appears
-
Update Script:
- Add selector to
addButtonSelectorsarray inconfigure-static-route-playwright.js - Test with
HEADLESS=true
- Add selector to
-
Verify:
- Run full automation
- Confirm it works without manual intervention
Success Criteria
✅ Automation is successful when:
- Script navigates to Static Routes page
- Form appears (either automatically or after manual click)
- Form is filled correctly
- Route is saved successfully
- Route appears in routes list
Support
For issues or questions:
- Check screenshots in
scripts/unifi/screenshots/ - Review script logs for error messages
- Use
HEADLESS=falseto see what's happening - Use
PAUSE_MODE=truefor manual intervention
Last Updated: 2026-01-14
Status: ✅ Complete and Ready to Use