---
title: Circle CI with Selenium integration
description: Run Selenium WebDriver and Appium tests with Circle CI. Receive reports
  and a video recording of your test.
source_url:
  html: https://testingbot.com/support/integrations/ci-cd/circleci
  md: https://testingbot.com/support/integrations/ci-cd/circleci/index.md
---
# Circle CI Automated Testing

Circle CI is a continuous integration service in the cloud.

It is very easy to use the TestingBot Selenium grid together with Circle CI.

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

## Get Circle CI up and running

Sign up at [Circle CI](https://circleci.com) and connect your project with Circle CI.

We recommend setting up [environment variables](https://circleci.com/docs/guides/security/set-environment-variable/) on the project settings page of CircleCI.   
 You can set up the `TB_KEY` and `TB_SECRET` variables there, so that they are not publicly visible.

**Example `.circleci/config.yml` file:**

    version: 2.1
    orbs:
      ruby: circleci/ruby@2.1.0
      node: circleci/node@5.2.0
    
    jobs:
      test:
        parallelism: 3 # depends on how many concurrent sessions your TestingBot subscription has
        docker:
          - image: cimg/ruby:3.2-node
        environment:
          TB_AUTOMATE_BUILD: "build No. $CIRCLE_BUILD_NUM for circleCI"
          SELENIUM_PLATFORM: WIN11
          SELENIUM_BROWSER: chrome
          SELENIUM_BROWSER_VERSION: "latest"
        steps:
          - checkout
          - ruby/install:
              version: '3.2'
          - ruby/install-deps
          - run: bundle exec cucumber
    
    workflows:
      test:
        jobs:
          - test

You can now use the environment variables, defined above and on CircleCI, in your code:

    require 'selenium/webdriver'
    
    url = "https://#{ENV['TB_KEY']}:#{ENV['TB_SECRET']}@hub.testingbot.com/wd/hub"
    
    options = Selenium::WebDriver::Chrome::Options.new
    options.add_option('platformName', ENV['SELENIUM_PLATFORM'] || 'WIN11')
    options.add_option('browserVersion', ENV['SELENIUM_BROWSER_VERSION'] || 'latest')
    options.add_option('tb:options', {
      'build' => ENV['TB_AUTOMATE_BUILD']
    })
    
    browser = Selenium::WebDriver.for(:remote, url: url, options: options)
    
    Before do |scenario|
      @browser = browser
    end
    
    at_exit do
      browser.quit
    end

### 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)
