-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.rb
More file actions
31 lines (28 loc) · 1.07 KB
/
Copy pathtest.rb
File metadata and controls
31 lines (28 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require "selenium-webdriver"
# If the requested test environment is not registered with the hub
# or busy, allow enough time for the Gridlastic auto scaling
# functionality to launch a node with the requested environment.
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 600 # seconds.
username = "TESTINIUMUSER"
key = "TESTINIUMPASS"
gridHost = "http://hub.testinium.io/wd/hub"
caps = Selenium::WebDriver::Remote::Capabilities.chrome(
:version => "46",
:platform => "WIN8_1",
:recordsVideo => true,
:takesScreenshot => true,
:browserName => "firefox",
:key => username+":"+key
)
driver = Selenium::WebDriver.for(:remote, :url => gridHost, :http_client => client, :desired_capabilities => caps)
driver.manage.timeouts.implicit_wait = 60
driver.manage.window.maximize
begin
driver.navigate.to "https://www.amazon.com/"
searchElement = driver.find_element(:id, 'twotabsearchtextbox')
searchElement.send_keys "Superman Comics"
searchElement.submit
ensure
driver.quit
end