Created
January 28, 2017 01:20
-
-
Save DylanLacey/ca90043029b1b4022b45b86efb450bf2 to your computer and use it in GitHub Desktop.
Blank Selenium Skellington
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##Blank Selenium Test | |
require "selenium/webdriver" | |
require 'selenium/webdriver/remote/http/persistent' | |
def un | |
ENV["SAUCE_USERNAME"] | |
end | |
def ak | |
ENV["SAUCE_ACCESS_KEY"] | |
end | |
def auth | |
"#{un}:#{ak}" | |
end | |
def server | |
"ondemand.saucelabs.com" | |
end | |
def port | |
80 | |
end | |
def endpoint | |
"#{server}:#{port}/wd/hub" | |
end | |
def auth_endpoint | |
"http://#{auth}@#{endpoint}" | |
end | |
def caps | |
#Make Me A Hash | |
end | |
http_client = ::Selenium::WebDriver::Remote::Http::Persistent.new | |
http_client.timeout = 300 # Browser launch can take a while | |
driver = Selenium::WebDriver.for :remote, :url => auth_endpoint, :desired_capabilities => caps, :http_client => http_client | |
driver.navigate.to "http://www.google.com" | |
driver.quit | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment