This Python script fetches manual test cases from an ALM Octane server and identifies references between them based on their test scripts.
- Python 3.x
requestspackage (pip install requests)- ALM Octane server access with valid API credentials
-
Clone the repository:
git clone https://github.com/your-repo/map_called_tests.git cd map_called_tests -
Create and activate a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
Modify the following constants in map_called_tests.py to match your ALM Octane setup:
CLIENT_ID = "your_client_id_here"
CLIENT_SECRET = "your_client_secret_here"
BASE_URL = "http://localhost:8080" # Adjust to your Octane server
SHARED_SPACE_ID = "1001" # Replace with your shared space ID
WORKSPACE_ID = "1002" # Replace with your workspace IDRun the script using:
python map_called_tests.pyThe script prints a mapping of test references in the format:
Test 1024 is referenced by: ['1026', '1026', '1027', '1031', '1033', '1068', '1073', '1075', '1088', '1119', '1209', '1210']
The script performs the following steps:
- Establishes a session with ALM Octane using API authentication.
- Fetches all manual test case IDs from the specified shared space and workspace.
- Iterates through each test ID, retrieves its script, and searches for references to other test IDs using the pattern
- @nnnn. - Constructs a mapping where each called test ID is associated with a list of test cases that reference it.
- Outputs the mapping of test references.
This project is licensed under the MIT License.
Feel free to submit pull requests or open issues for improvements.