BrowserStack
Testmo can be used with practically any test automation tool, including browser automation cloud services such as BrowserStack. This article provides an overview of using Testmo with Selenium & BrowserStack to run your browser tests and submit test results to implement BrowserStack test management.

1. Build the test suite

BrowserStack is used with a browser automation library such as Selenium to automate web browsers. Selenium itself is not directly a test automation framework (it is a general purpose browser automation tool) so you would use an additional testing framework to run tests and report results.
You can choose any test automation framework and programming language you are familiar with. Selenium is often used with JavaScript/NodeJS, Java, C#, Python, Ruby or PHP, among other languages. You can find the official bindings (client libraries) for Selenium on the website.
Writing a complete test automation suite is outside of the scope of this article, but we have multiple complete articles on writing tests with Selenium and integrating the test suite with various services. So if you are not yet familiar with Selenium and don't have a test suite yet, please review our articles on getting started with your first Selenium tests:
You can also find fully working example projects for the above articles on GitHub. Please review the relevant code repositories here:

2. Generate test result files

To submit and report test results to Testmo, you execute your automated tests and generate a test result report file. To exchange test results between testing tools, the JUnit XML file format has become the de facto standard over time. Practically any testing tool can generate or convert test results to this format. Testmo directly supports this format as well, so it's very easy to report your test automation results.
In our above articles we are using a simple NodeJS (JavaScript) based testing framework called Macha/Chai. But any other testing framework can be used as well and you just need to configure it to generate report files. Here's an example of running a Selenium test automation suite that uses a web browser running on BrowserStack to search the web for various search terms (also see our full article for this example):
1
$ npm run test-junit
2
3
> test
4
> node_modules/mocha/bin/mocha test.mjs
5
6
search
7
✔ should search for "Selenium"
8
✔ should search for "Appium"
9
✔ should search for "Mozilla"
10
✔ should search for "GitHub"
11
✔ should search for "GitLab"
12
13
5 passing (7ms)
Copied!
The above command runs the test-junit script alias we defined for the project, which instructs Mocha/CHai to run our tests and write all test results to an XML file. We are also running our tests against browsers running on BrowserStack. If you use a different programming language you would use the same approach here. We have links to documentation for many test automation frameworks on generating the correct file format.

3. Submit results to Testmo

We have now successfully executed our test automation suite and generated the report XML file with our test results. We can now send the test results to Testmo so we can report the test run and track all our results, identify problematic tests (such as slow or flaky tests) and share the test run with the entire team.
To submit the test results, we use the Testmo CLI tool. This tool makes it very easy to send the results to Testmo and everything is handled automatically for you, including creating test automation runs, adding new tests, submitting all results and reporting the run status. We start by installing the tool on our system by using the NPM package manager, which is usually installed on most systems already. You can also learn more about installing the Testmo CLI tool here.
1
$ npm install -g @testmo/testmo-cli
2
$ testmo -h
3
4
Usage: testmo [options] [command]
5
[...]
Copied!
The CLI tool supports various commands and the easiest way to submit a complete test automation run is to use the automation:run:submit command. This command creates a new automation run, submits all results and then marks the run as completed.
1
$ TESTMO_TOKEN=******** testmo automation:run:submit \
2
--instance https://<your-name>.testmo.net \
3
--project-id 1 \
4
--name 'BrowserStack test run' \
5
--source 'frontend' \
6
--results results/*.xml
7
8
Collecting log files ..
9
Found 1 result files with a total of 5 tests
10
Created new automation run (ID: 254)
11
Created new thread (ID: 608)
12
Sending tests to Testmo ..
13
Uploading: [|||||||||||||||||||||||||||||||||||||] 100% | ETA: 0s | 5/5 tests
14
Successfully sent tests and completed run
15
Marked the run as completed
Copied!
You need an API key for your Testmo user (or for a separate API user) to authenticate and submit your test results. Learn more about generating API keys.
This is just a basic example of using Testmo with Selenium and BrowserStack. The testmo tool also supports various other features, such as launching your test automation tool directly to capture the console output, record exit codes and measure test times. You can also submit additional fields, artifacts and links with your test runs. See the full documentation for more details.

4. Bonus: CI integration, parallel execution & more

Testmo also supports advanced test automation workflows such as submitting test runs for multiple test suites and reporting parallel test execution. You can also report your test automation runs from your CI pipeline and build systems. See the following guides and examples on further topics:
We have additional guides on how to integrate and submit your automated test results to Testmo from various popular CI/CD services and build tools: