LoadDensity provides a full command-line interface via python -m je_load_density.
| Argument | Short | Description |
|---|---|---|
--execute_file |
-e |
Execute a single JSON script file |
--execute_dir |
-d |
Execute all JSON files in a directory |
--execute_str |
— | Execute an inline JSON string |
--create_project |
-c |
Scaffold a new project with templates |
Run a test defined in a single JSON keyword file:
python -m je_load_density -e test_scenario.jsonThe JSON file should follow the action list format:
[
["LD_start_test", {
"user_detail_dict": {"user": "fast_http_user"},
"user_count": 50,
"spawn_rate": 10,
"test_time": 5,
"tasks": {
"get": {"request_url": "http://httpbin.org/get"},
"post": {"request_url": "http://httpbin.org/post"}
}
}]
]Run all JSON keyword files in a specified directory recursively:
python -m je_load_density -d ./test_scripts/This scans the directory for all .json files and executes each one sequentially.
Execute a JSON action list directly as a string:
python -m je_load_density --execute_str '[["LD_start_test", {"user_detail_dict": {"user": "fast_http_user"}, "user_count": 10, "spawn_rate": 5, "test_time": 5, "tasks": {"get": {"request_url": "http://httpbin.org/get"}}}]]'Note
On Windows, inline JSON strings are automatically double-parsed due to shell escaping differences. The CLI handles this transparently.
Scaffold a new project with keyword templates and executor scripts:
python -m je_load_density -c MyProjectThis generates a project directory structure:
MyProject/
└── LoadDensity/
├── keyword/
│ ├── keyword1.json
│ └── keyword2.json
└── executor/
├── executor_one_file.py
└── executor_folder.py
If no valid argument is provided, the CLI raises a LoadDensityTestExecuteException
and exits with code 1. All errors are printed to stderr.