A lightweight, script-driven browser automation tool built with Java and Selenium WebDriver. Define browser workflows in simple text files — no coding required — and integrate results directly into Zabbix monitoring.
- Script-driven automation — Write browser workflows as plain-text instruction files
- Multi-tab support — Open, switch between, and close browser tabs within a single run
- Encrypted credentials — Store passwords securely using AES-256-GCM encryption; never hardcode credentials in scripts
- Zabbix integration — Push execution status, response times, and results to one or more Zabbix servers automatically
- Headless mode — Run Firefox without a visible GUI, ideal for servers and CI pipelines
- Flexible configuration — All settings controlled through
config.properties
| Requirement | Version | Notes |
|---|---|---|
| Java | 11+ | JDK required to build; JRE sufficient to run |
| Firefox | Any recent | Must be installed on the machine |
| GeckoDriver | Matching Firefox version | Download here |
| Maven | 3.6+ | For building from source |
| Zabbix Server | Any | Optional — only if using monitoring integration |
git clone https://github.com/your-username/selenium-script-runner.git
cd selenium-script-runnerDownload the GeckoDriver binary for your OS from Mozilla's releases page and place it at:
resources/geckodriver.exe # Windows
resources/geckodriver # Linux/macOS
Copy and edit the configuration file:
cp config.properties config.properties.localEdit config.properties to set your Firefox path, GeckoDriver path, and (optionally) Zabbix server details. See Configuration Reference below.
mvn clean packageThis produces a fat JAR at target/selenium-script-runner-1.0.0.jar.
java -jar target/selenium-script-runner-1.0.0.jar example_scriptRun multiple scripts (each in its own browser tab):
java -jar target/selenium-script-runner-1.0.0.jar script_one script_two script_threeScripts are plain text files placed in the scripts/ directory. Each line is a command in command=value format. Lines starting with # are comments.
| Command | Syntax | Description |
|---|---|---|
open_URL |
open_URL=https://example.com |
Navigate to a URL |
wait |
wait=3 |
Pause for N seconds |
wait_for_text_selector |
wait_for_text_selector=<xpath>,<timeout>,<expected_text> |
Wait until an element contains a specific string |
click |
click=<xpath> |
Click an element |
input |
input=<xpath>,<text> |
Type text into a field |
input_password |
input_password=<xpath> |
Type stored encrypted password into a field |
scroll_to_bottom |
scroll_to_bottom |
Scroll to the bottom of the page |
open_new_tab |
open_new_tab |
Open a new browser tab |
switch_to_tab |
switch_to_tab=<index> |
Switch to tab by index (0-based) |
close_tab |
close_tab |
Close the current tab |
# Login to an application and verify the dashboard loads
open_URL=https://app.example.com/login
wait=2
wait_for_text_selector=/html/body/h1,10,Welcome Back
click=/html/body/form/input[@name='username']
input=/html/body/form/input[@name='username'],myuser
click=/html/body/form/input[@name='password']
input_password=/html/body/form/input[@name='password']
click=/html/body/form/button[@type='submit']
wait=5
wait_for_text_selector=/html/body/div[@class='dashboard']/h2,15,Dashboard
Never put passwords in plain-text scripts. The runner includes built-in AES-256-GCM credential encryption.
java -jar target/selenium-script-runner-1.0.0.jar credentialsFollow the prompts — enter the script name and password. Encrypted files are saved to credentials/ and are excluded from Git via .gitignore.
Use input_password=<xpath> in your script. The runner automatically looks for a matching credential file for the current script name.
All settings live in config.properties:
# WebDriver
webdriver.gecko.driver=resources/geckodriver.exe
firefox.binary.path=C:\Program Files\Mozilla Firefox\firefox.exe
firefox.headless=false
# Logging
show.logs=true
show.responseTime=false
# Zabbix (optional)
zabbix.sender=false
multiple.zabbix.servers=false
1.zabbix.server.ip=YOUR_ZABBIX_SERVER_IP
zabbix.server.port=10051
zabbix.sender.path=resources/zabbix/bin/zabbix_sender.exeWhen zabbix.sender=true, the runner automatically sends:
- Execution status (success / failure) per script
- Response time (time from script start to completion)
Configure your Zabbix host and item keys to match your hostnames. Multiple Zabbix servers are supported using numbered properties (1.zabbix.server.ip, 2.zabbix.server.ip, etc.).
selenium-script-runner/
├── src/
│ └── main/
│ └── java/
│ └── SeleniumScriptRunner.java # Main application
├── scripts/
│ └── example_script # Example automation script
├── resources/
│ ├── geckodriver.exe # GeckoDriver binary (not in Git)
│ └── zabbix/
│ ├── bin/ # Zabbix sender binaries (not in Git)
│ └── conf/
│ └── zabbix_agentd.conf # Zabbix agent config template
├── credentials/ # Encrypted credential files (not in Git)
├── config.properties # Runtime configuration
├── pom.xml # Maven build file
└── .gitignore
# Build fat JAR (includes all dependencies)
mvn clean package
# The output JAR is at:
target/selenium-script-runner-1.0.0.jarThe Maven Shade plugin bundles all Selenium dependencies into a single executable JAR for easy deployment.
- Never commit real credentials — the
credentials/directory is in.gitignore - Never put passwords in script files — use the
credentialscommand andinput_passworddirective - Review your scripts before pushing — ensure they don't contain internal URLs, usernames, or IP addresses
- Zabbix IPs in
config.propertiesare placeholders — replace before running, don't commit real values
MIT License. See LICENSE for details.
Pull requests are welcome. For major changes, please open an issue first to discuss what you'd like to change.