---
title: GitLab CI Selenium WebDriver Integration
description: Run Automated Mobile and Web Tests with Selenium and Appium on GitLab
  CI
source_url:
  html: https://testingbot.com/support/integrations/ci-cd/gitlab
  md: https://testingbot.com/support/integrations/ci-cd/gitlab/index.md
---
# GitLab CI Automated Testing

GitLab CI/CD is a part of GitLab and provides a Continuous Integration system to run automated tests.

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

## 1. Get GitLab CI up and running

Download [GitLab CI](https://about.gitlab.com/product/continuous-integration/) and set up GitLab CI to your requirements.

## 2. Create a simple Selenium test

Add a simple Selenium test to your GitLab project, modify the .gitlab-ci.yml file in your repository to indicate you want to run a Selenium test.

Example `.gitlab-ci.yml` file:

    image: node:latest
    stages:
      - Test TestingBot
    
    Selenium Test:
      stage: Test TestingBot
      before_script:
        - npm install
        - npm install selenium-webdriver
      script:
        - node sample_test.js

Add your `TESTINGBOT_KEY` and `TESTINGBOT_SECRET` environment variables to [GitLab CI/CD variables](https://docs.gitlab.com/ee/ci/variables/).

    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.CI_JOB_ID ? ("GitLab Build " + process.env.CI_JOB_ID) : "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();

Now you're ready to run this first sample test with GitLab CI.

### Looking for more help?

Have questions or need more information? Reach out via email or Slack.

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