Skip to content

Instantly share code, notes, and snippets.

@bramhaghosh
Created October 11, 2012 17:51
Show Gist options
  • Select an option

  • Save bramhaghosh/3874284 to your computer and use it in GitHub Desktop.

Select an option

Save bramhaghosh/3874284 to your computer and use it in GitHub Desktop.

Revisions

  1. bramhaghosh created this gist Oct 11, 2012.
    20 changes: 20 additions & 0 deletions saucelabs_demo.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    require 'pry'
    require 'watir-webdriver'
    include Selenium

    def capabilities
    opts = {:platform => :any, :javascript_enabled => true}
    capabilities = WebDriver::Remote::Capabilities.ie(opts)
    end

    def set_up_grid_browser
    @browser = Watir::Browser.new(:remote,
    :url => "http://uniuq_username_goes_here:0797186a-8407-4966-a9cd-fbf954d92b3c@ondemand.saucelabs.com:80/wd/hub",
    :desired_capabilities => capabilities)

    @browser.driver.manage.timeouts.implicit_wait = 30
    @browser
    end

    set_up_grid_browser
    binding.pry