---
title: Travis CI with Selenium & Appium integration.
description: Run Selenium WebDriver and Appium tests with Travis CI.
source_url:
  html: https://testingbot.com/support/integrations/ci-cd/travis-ci
  md: https://testingbot.com/support/integrations/ci-cd/travis-ci/index.md
---
# Travis CI Automated Testing

Travis CI's free open-source plan was retired in 2021 and the service is now paid-only with limited free credits. If you're starting fresh, consider [GitHub Actions](https://testingbot.com/support/integrations/ci-cd/github-actions) or [GitLab CI](https://testingbot.com/support/integrations/ci-cd/gitlab) instead. This guide is kept for existing Travis users.

Travis CI is a continuous integration service which you can use to test your GitHub projects.

It is straightforward to use the TestingBot Selenium grid together with Travis CI.

Below are the steps to run your Selenium tests via Travis CI, once the tests are up and running you can even display a TestingBot Status badge showcasing your Selenium tests status.

## 1. Get Travis CI up and running

Sign up at [Travis CI](https://www.travis-ci.com/) and connect your GitHub project with Travis CI.   
 You can find information on how to do this at the Travis CI [help section](https://docs.travis-ci.com/).

## 2. Create a simple Selenium test

Add a simple Selenium test to your GitHub project, modify the `.travis.yml` file in your repository to indicate you want to run a Selenium test.

Example `.travis.yml` file:

    language: node_js
    node_js:
      - 22
    env:
    - [
        {secure: "akuE0dld1Ke9mahjUUrQhUZRYWasdfewfwefewfZlbvOx\nqaPybirPGsDmImvcktaAkjLxpePd0V1+ak+4dws7dTrFfEsdvsdsdvsdvds2\nud1q5oGOzEqfiRGxY/fJHLWlaQ609Bsdfdsfds2VeY1Z/V7N9iQ="},
        {secure: "JGfkAfr/SOlzV+NpgNi3fxP4F2usdfdsveGAppugHj1IxhoyjY\nOp07x4p1hdIfWVF03RqUrPNXkl72+yh53pv2fUzsdfsd3434GRjGy6J6\notuA/N+xs0+TP2ENlCmDauwO32Okfojvj7CgvsdfdsfRyaFzIGWPdw="}
      ]
    script:
    - "node tests/examples/*.js"

The two secure lines in the above example are your TestingBot key and secret, used to run a test on our Grid.   
 To generate these 2 lines, you need to install the Travis CI gem and run these commands with your own key and secret:

    travis encrypt username/projectname TESTINGBOT_KEY=my_key
    travis encrypt username/projectname TESTINGBOT_SECRET=my_secret

Now you can use the encrypted `TESTINGBOT_KEY` and `TESTINGBOT_SECRET` environment variables in your tests.   
 Below is a NodeJS example:

    npm install -g selenium-webdriver

    const webdriver = require('selenium-webdriver');
    const chrome = require('selenium-webdriver/chrome');
    
    async function runSampleTest () {
      let driver;
      try {
        let options = new chrome.Options();
        options.set('platformName', 'WIN11');
        options.set('browserVersion', 'latest');
        options.set('tb:options', {
          'key': process.env.TESTINGBOT_KEY,
          'secret': process.env.TESTINGBOT_SECRET,
          'name': (process.env.TRAVIS_BUILD_NUMBER ? ("Travis Build " + process.env.TRAVIS_BUILD_NUMBER) : "Simple Test")
        });
    
        driver = new webdriver.Builder()
          .usingServer("https://hub.testingbot.com/wd/hub")
          .withCapabilities(options)
          .build();
    
        await driver.get('https://www.google.com');
    
        var title = await driver.getTitle();
        console.log("title is: " + title);
      } catch (e) {
        console.log(e);
      } finally {
        if (driver) {
          await driver.quit();
        }
      }
    }
    runSampleTest();

Was this page helpful? Yes No 

## Looking for More Help?

Have questions or need more information?   
 You can reach us via the following channels:

- [Email us](https://testingbot.com/contact/new)
- [Join our Slack Channel](https://join.slack.com/t/testingb0t/shared_invite/zt-3bcw9xch-jk19~6XPs_xBrsAgAedkCw)
