This repository provides a Java-based integration between Vansah and BrowserStack, enabling seamless Test Result synchronization and automated execution reporting.
It allows teams to connect BrowserStack Test Runs directly with Vansah Test Management, ensuring real-time visibility of automated test outcomes within Jira.
With this integration, you can:
- Automatically update Vansah Test Results from BrowserStack executions
- Link automated tests with Vansah Test Cases and Test Runs
- Streamline CI/CD workflows for improved traceability and reporting
Website • More Connect Integrations
- Features
- Prerequisites
- Install / Clone
- Configure Credentials (Environment Variables)
- Execute Tests on BrowserStack
- Viewing Results & Traceability
- Project Layout
- Implementation in Your Project
- Reference
- Contributing
- Developed By
- ✅ Ready-to-run JUnit 5 and Selenium tests on BrowserStack
- ✅ Integrates with Vansah Java Binding to create Test Runs and Log Steps (with screenshots)
- Java 11+ and Maven 3.8+
- Access to a BrowserStack account with Username and Access key
- Ensure Vansah is installed in your Jira workspace
- Generate a Vansah Connect Token to authenticate with Vansah APIs
- Ensure that your Test Case Key is linked to a Jira Issue, and a Test Folder
git clone https://github.com/testpointcorp/vansah-browserstack-java.git
cd vansah-browserstack-javaCreate a .env file in your project root (do not commit this file to version control).
Below is an example configuration for BrowserStack and Vansah:
# -------------------------------
# BrowserStack Configuration
# -------------------------------
export BROWSERSTACK_USERNAME=<your-username>
export BROWSERSTACK_ACCESS_KEY=<your-access-key>
export BROWSERSTACK_BUILD_NAME="Vansah Build"
export BROWSERSTACK_PROJECT_NAME="Vansah BrowserStack"
export BROWSERSTACK_SESSION_NAME="Vansah Trial Runs"
# -------------------------------
# Vansah Configuration
# -------------------------------
export VANSAH_BASE_URL= # https://help.vansah.com/en/articles/10407923-vansah-api-connect-url
export VANSAH_API_TOKEN= # https://help.vansah.com/en/articles/9824979-generate-a-vansah-api-token-from-jira
export VANSAH_ENVIRONMENT= # https://help.vansah.com/en/articles/9821822-test-environments
export VANSAH_TESTCASE_KEY= # https://help.vansah.com/en/articles/12814796-what-is-a-test-case#h_529238a0fc
# -------------------------------
# Choose ONE style for Vansah execution
# -------------------------------
# (A) Jira Issue style
export VANSAH_JIRA_ISSUE_KEY= # https://help.vansah.com/en/articles/9822263-linking-test-cases-to-a-jira-issue
export VANSAH_PROJECT_KEY= # https://help.vansah.com/en/articles/9821808-updating-your-jira-project-key
# (B) Folder style
export VANSAH_FOLDER_PATH= # https://help.vansah.com/en/articles/9824708-test-folder-path-in-test-case-export
# (C) Standard Test Plan (STP)
# export VANSAH_STP_KEY= # https://help.vansah.com/en/articles/9824605-creating-a-test-plan-from-a-test-folder
# (D) Advanced Test Plan (ATP)
# export VANSAH_ATP_KEY= # https://help.vansah.com/en/articles/9855761-understanding-advanced-test-plans
# export VANSAH_ATP_ASSET_TYPE="folder" # or 'issue'Alternatively, create a .env file using the sample file located at:
src/test/resources/.env.example
Run the Maven project to execute your test suite:
mvn test- The test opens selenium.vansah.io on a real Chrome instance in BrowserStack.
- It validates the page title, captures Screenshots, Logs each step to Vansah, and updates the BrowserStack session status as passed/failed.
- Screenshots are stored under
target/screenshots/and automatically uploaded to Vansah via theaddTestLog(...)method.
- BrowserStack: View live and saved sessions, videos, and execution logs for each build.
- Vansah: Open your project, Test Plan, or Test Run to access:
- Test case execution status
- Linked BrowserStack session URL
- Error messages and stack traces
- Execution metadata (build, environment, browser/OS)
vansah-browserstack-java/
├─ src/
│ ├─ main/
│ │ └─ java/
│ │ └─ com/
│ │ └─ vansah/
│ │ └─ VansahNode.java
│ └─ test/
│ ├─ java/
│ │ └─ com/
│ │ └─ example/
│ │ └─ browserstack/
│ │ ├─ TestSetup.java
│ │ └─ VansahBrowserStackTest.java
│ └─ resources/
│ └─ .env.example
├─ target/
│ ├─ surefire-reports/
│ └─ screenshots/
├─ .gitignore
├─ pom.xml
├─ README.md
Notes:
- Copy
src/test/resources/.env.exampleto your project root as.env. - The
target/directory stores build artifacts, reports, and screenshots.
This demo project leverages VansahNode.java to send results to Jira.
Before integrating it into your own project, ensure this demo runs successfully.
- Download
VansahNode.javafrom the repository. - Copy it into your project’s Java source directory.
- Confirm the following dependencies exist in your
pom.xml:
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
<dependency>
<groupId>com.mashape.unirest</groupId>
<artifactId>unirest-java</artifactId>
<version>1.4.9</version>
</dependency>
<dependency>
<groupId>io.github.cdimascio</groupId>
<artifactId>dotenv-kotlin</artifactId>
<version>6.5.1</version>
</dependency>Refer to our help page
Get Vansah API Connect URL
Generate a Vansah Api Token
Generate and configure Vansah Test Environment
What is the Test Case in Vansah
Linking a Test Case to a Jira Issue
Get Vansah Project Key
Link Test Cases to Test Folder
Get Vansah Folder Path
More Info on Advanced Test Plan
We welcome contributions!
Feel free to open issues or submit pull requests to improve this integration.