Overview
The Vansah Python binding is a single class, VansahNode.py, that you add to your test project and call from your existing tests. It works with pytest, unittest, Behave, Robot Framework, Selenium and Playwright (Python), and connects to the Vansah REST API.
Before you begin
Vansah Test Management is installed in your Jira workspace.
You have generated a Vansah Connect token - see Create a Vansah API Token.
You have your Vansah API Connect URL. see Vansah API Connect URL.
Your project uses Python 3.8 or newer.
Step-by-step
Step 1: Install the dependency
The binding uses the requests library. Install it with pip:
Step 2: Add the VansahNode client to your project
Open the GitHub repository: github.com/testpointcorp/vansah-python-binding
Copy the file VansahNode.py.
Paste it into your test project (next to your tests) and import it with "from VansahNode import VansahNode".
Step 3: Configure the token, URL and Space Key
Create a VansahNode instance and set your token, API URL, and Space Key. The Space Key is your Jira project key and is required for API v2.
Where to find these: generate your token in Create a Vansah API Token, and copy your API URL from Vansah API Connect URL.
Step 4: Create a test run
Choose the run type that matches how your test case is organised. Set the matching context (issue key, folder path, or test plan key) first, then create the run.
Against a Jira issue
Against a Test Folder
Not sure of the folder path? See Getting the folder path of a test folder. The path must contain a "/" and must not start with "/".
Against an Advanced Test Plan (ATP)
Against a Standard Test Plan (STP)
Note: Test plan runs target iteration 1 by default. To record results against a different iteration, call vansah.set_test_plan_iteration(n) - where n is 1 to 5 - before add_test_run_from_advanced_test_plan or add_test_run_from_standard_test_plan. This applies to Test Plan runs only, not Jira-issue or folder runs.
Step 5: Log your test results
For step-by-step tests, log a result for each step. The result can be a name ("passed", "failed", "na", "untested" - case-insensitive; note na, not n/a) or an int (0 = N/A, 1 = FAIL, 2 = PASS, 3 = Not tested).
Tip: For a single overall result with no steps, use a Quick Test instead: vansah.add_quick_test_from_jira_issue("KAN-C17", 2) # 2 = PASS
Step 6: Attach a screenshot (optional)
Pass a screenshot path (string) to add_test_log or update_test_log and the binding uploads it and links it to the log.
Step 7: Enable debug logging (optional)
If a run or log is not appearing as expected, turn on payload logging to see the exact JSON the binding sends to Vansah.
Step 8: Run your tests and view results in Vansah
· Run your automated tests as usual.
· Open the linked Jira issue, test folder, or test plan in Vansah.
· Confirm the new test run and its step logs (and any screenshots) appear.
Full example (Folder, ATP and STP)
Method reference
add_test_run_from_jira_issue(testcase)
Creates a run linked to a Jira issue (set via set_jira_issue_key).
add_test_run_from_test_folder(testcase)
Creates a run under a Vansah test folder (set via set_test_folders_path).
add_test_run_from_advanced_test_plan(asset_type, testcase)
Creates a run under an ATP. asset_type is "folder" or "issue".
add_test_run_from_standard_test_plan(testcase)
Creates a run under a Standard Test Plan.
add_test_log(result, comment, step, image_path=None)
Logs one step result (+ optional screenshot path). result: name NA/FAILED/PASSED/UNTESTED or int 0-3.
update_test_log(result, comment, image_path=None)
Updates the most recent log with a new result/comment/screenshot.
add_quick_test_from_jira_issue(testcase, result)
Single overall result against a Jira issue (name or int).
add_quick_test_from_test_folder(testcase, result)
Single overall result under a test folder (name or int).
test_step_count(case_key)
Returns the number of steps in a test case - handy for iterating over each step.
remove_test_run()
Deletes the most recently created test run.
remove_test_log()
Deletes the most recently created test log (a fresh Untested placeholder is put back for that step).
Configuration (setter) methods
set_vansah_token(token) - Vansah Connect token used to authenticate requests.
set_vansah_url(url) - Vansah API base URL
set_project_key(key) - Space Key (Jira project key). Required for API v2.
set_test_folders_path(path) - Test folder path. Must contain "/" and must not start with "/".
set_jira_issue_key(key) - Jira issue key to attach runs/logs to.
set_sprint_name(name) - Optional. Associates runs with a sprint.
set_release_name(name) - Optional. Associates runs with a release/version.
set_environment_name(name) - Optional. Tags runs with an environment (e.g. SYS, UAT).
set_advanced_test_plan_key(key) - Advanced Test Plan key (e.g. KAN-P17).
set_standard_test_plan_key(key) - Standard Test Plan key (e.g. KAN-P18).
set_test_plan_iteration(n) - Optional. Targets a specific STP/ATP iteration (1-5). Defaults to 1 if not set.
set_debug(flag) - Enables request-payload logging. Also enabled via VANSAH_DEBUG=1 (the token is never printed).
Related articles
· Create a Vansah API Token
· Vansah API Connect URL
· Getting the folder path of a test folder
· Generate a Vansah API Token from Jira
· Install Vansah Test Management for Jira (Atlassian Marketplace)
· Vansah for Jira - May 2026 (Forge release)
· What's new in Vansah - Migration to Forge Platform
· More Connect Integrations
· Vansah Support Portal
· GitHub repository - vansah-python-binding
