Written by Owen Ling 18/07/25
Located in Scripting & Automation/ROH/Trail
Version B.1
A simple Python utility to automate the UI process for adding multiple assets to a Trail.fi reservation, using the Selenium web UI automation framework, written for the ROH.
Clone the repository
git clone https://github.com/OLI6532/Trail-Reservations-Bulk-AddCreate a dedicated automated user in Trail with the minimum required privileges for the task and ass their login details
to a .env file as below, located in the same directory as the bulk_add_to_reservation.py file.
TRAIL_USERNAME=example@example.com
TRAIL_PASSWORD=foobar1234- Configure and activate the Python virtual environment:
cd Trail-Reservations-Bulk-Add
python -m venv .venv
source .venv/bin/activate(.venv)should now be shown at the start of the terminal prompt, e.g.;
(.venv) wing2 OLI-M-2 ~/Trail-Reservations $ Note
To exit the virtual environment, enter deactivate
- Install the project requirements:
pip install -r requirements.txt - Define a list of barcodes in a
.CSVfile that you want to add to the reservation - Identify the reservation ID found in the URL when opened in Trail
- Run the script
python reservation_bulk_add.py -R <reservation_id> -C <path_to_csv_file> -S <site_url> --headless
-RThe ID of the reservation to add barcodes to-CPath to the CSV file containing the list of barcodes to add-SThe Trail Site URL to use for the session. e.g.;foo.trail.fi-TNumber of threads to use for concurrent browser sessions (Default: 3)-HRuns in headless mode, doesn't show the browser window (Optional)-UThe username to log in with (Optional)-PThe password of the username to log in with (Optional)-QSuppresses all STDOUT messages, except for errors-hShow help