Skip to content

singhsantosh230798/KotlinTestNGSeleniumSDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KotlinTestNGSeleniumSDK

This repository demonstrates how to run Selenium tests in Kotlin Testng on BrowserStack Automate using BrowserStack SDK.

kotlin-testng-browserstack

TestNG Integration with BrowserStack.

BrowserStack Logo

Using Maven

Run sample build

  1. Clone the repository

  2. Set BrowserStack Credentials Save your BrowserStack credentials as environment variables for easier access and improved security.

macOS/Linux

export BROWSERSTACK_USERNAME="your_username"
export BROWSERSTACK_ACCESS_KEY="your_access_key"

Windows PowerShell

$env:BROWSERSTACK_USERNAME="your_username"
$env:BROWSERSTACK_ACCESS_KEY="your_access_key"

Windows CMD

set BROWSERSTACK_USERNAME=your_username
set BROWSERSTACK_ACCESS_KEY=your_access_key
  1. Install BrowserStack SDK using Maven Archetype Use Maven Archetype to quickly scaffold SDK configuration in your project. It automatically adds browserstack-java-sdk in your pom.xml and creates a browserstack.yml config file.

macOS or Linux:

mvn archetype:generate -B -DarchetypeGroupId=com.browserstack \
-DarchetypeArtifactId=browserstack-sdk-archetype-integrate -DarchetypeVersion=1.0 \
-DgroupId=com.browserstack -DartifactId=browserstack-sdk-archetype-integrate -Dversion=1.0 \
-DBROWSERSTACK_USERNAME=your_username -DBROWSERSTACK_ACCESS_KEY=your_access_key \
-DBROWSERSTACK_FRAMEWORK=testng

Windows:

mvn archetype:generate -B -DarchetypeGroupId=com.browserstack ^
-DarchetypeArtifactId=browserstack-sdk-archetype-integrate -DarchetypeVersion=1.0 ^
-DgroupId=com.browserstack -DartifactId=browserstack-sdk-archetype-integrate -Dversion=1.0 ^
-DBROWSERSTACK_USERNAME=your_username -DBROWSERSTACK_ACCESS_KEY=your_access_key ^
-DBROWSERSTACK_FRAMEWORK=testng
  • Install dependencies mvn compile
  • To run the test suite having cross-platform with parallelization, run mvn clean test -DsuiteXmlFile=testng.xml

Understand how many parallel sessions you need by using our Parallel Test Calculator

Integrate your test suite

This repository uses the BrowserStack SDK to run tests on BrowserStack. Follow the steps below to install the SDK in your test suite and run tests on BrowserStack:

  • Add maven dependency of browserstack-java-sdk in your pom.xml file
<dependency>
    <groupId>com.browserstack</groupId>
    <artifactId>browserstack-java-sdk</artifactId>
    <version>LATEST</version>
    <scope>compile</scope>
</dependency>

Notes

About

This repository demonstrates how to run Selenium tests in Kotlin Testng on BrowserStack Automate using BrowserStack SDK.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages