Skip to content

Instantly share code, notes, and snippets.

@javidjamae
Created April 5, 2016 23:21
Show Gist options
  • Save javidjamae/3c002c20b3b31413ee5e1a1b8e6d70a4 to your computer and use it in GitHub Desktop.
Save javidjamae/3c002c20b3b31413ee5e1a1b8e6d70a4 to your computer and use it in GitHub Desktop.
Set up Selenium to use Sauce Labs without a gem
capabilities_config = {
:version => "43",
:browserName => "firefox",
:platform => "OS X 10.9",
:name => "Whatever name I want"
}
sauce_username = ENV['SAUCE_LABS_USERNAME']
sauce_api_key = ENV['SAUCE_LABS_API_KEY']
sauce_url = "http://#{sauce_username}:#{sauce_api_key}@ondemand.saucelabs.com:80/wd/hub".strip
driver = Selenium::WebDriver.for(:remote, :url => sauce_url, :desired_capabilities => capabilities_config)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment