Skip to content

Instantly share code, notes, and snippets.

@nikita-barsukov
Created July 20, 2015 12:34
Show Gist options
  • Save nikita-barsukov/cf1dd4d4a4027135874b to your computer and use it in GitHub Desktop.
Save nikita-barsukov/cf1dd4d4a4027135874b to your computer and use it in GitHub Desktop.
Loading dashboard page of GotoAssist Service desk.
require 'selenium-webdriver'
module Scenario
def g2a_dashboard(driver, opts={})
driver.get 'https://desk.gotoassist.com'
driver.find_element(:name, 'emailAddress').send_keys opts[:email]
driver.find_element(:name, 'password').send_keys opts [:password]
req_start = Time.now
driver.find_element(:id, 'credentials').submit
# waiting until all the incidents on dashboard are loaded
Selenium::WebDriver::Wait.new(timeout: 30).until do
driver.find_elements(css: '.customizable-table-data-row').length == opts[:rows]
end
latency = Time.now - req_start
opts[:log_file].puts latency if opts[:log_file]
puts latency
end
end
include Scenario
log_file = File.open('log/seq_browser.log', 'w')
100.times {
switches = %w[--ignore-certificate-errors --disable-popup-blocking --disable-translate]
driver = Selenium::WebDriver.for :chrome, switches: switches
Scenario::g2a_dashboard(driver, log_file: log_file, rows: 8, email: ENV['EMAIL'], password: ENV['PASS'])
driver.quit
}
log_file.close
puts 'Testing completed!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment