Skip to content

Instantly share code, notes, and snippets.

View aaronhumerickhouse's full-sized avatar

aaronhumerickhouse

View GitHub Profile
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://app-assets3.stage.ngin-staging.com/site_stylesheets/8862/page_elements.css?1432844760">
<link rel="stylesheet" type="text/css" href="http://app-assets1.stage.ngin-staging.com/site_stylesheets/8862/sports.css?1432844760">
<link rel="stylesheet" type="text/css" href="http://app-assets1.stage.ngin-staging.com/site_stylesheets/8862/prime_v3.css?1432844760">
<link rel="stylesheet" type="text/css" href="http://app-assets1.stage.ngin-staging.com/stylesheets/print/website_print.css?1432844760">
</head>
<body id="photo_gallery" class="prime_v3 logged_in">
<div id="top"></div>
@aaronhumerickhouse
aaronhumerickhouse / click_test.rb
Created January 2, 2015 14:39
Selenium Script for Click Defect
require "selenium-webdriver"
profile = Selenium::WebDriver::Firefox::Profile.new
profile.native_events = true
driver = Selenium::WebDriver.for :firefox, profile: profile
driver.navigate.to 'http:/google.com'
element = driver.find_element(:name, 'q')
element.send_keys 'Hello Webdriver!'
element.submit

#Time Analysis of Running Selenium Tests in Parallel

##Introduction Having recently joined Sport Ngin as an Automation Engineer, I needed to choose a strategy to execute an Automation Regression Suite. With the vastness that is our web applications, we need to be able to perform Automated Regression Tests in a way that avoids disrupting development workflow without sacrificing the value it provides. Thankfully there are tools that aim to balance usefulness and unobtrusiveness. I'm going to talk specifically about tools based around Selenium WebDriver. Selenium Grid 2 easily allows for testing multiple browsers on multiple computers. There's BrowserStack and Sauce Labs which are SaaS services that run on top of Selenium Grid 2 utilizing Amazon's AWS EC2 instances. There are also other tools that help create distributive systems, such as Jenkins. I've created a handful of Automation Frameworks in the past and have run them on a local server farm as well as in Sauce Labs and in BrowserStack. Comparing th

@aaronhumerickhouse
aaronhumerickhouse / test1_spec.rb
Created November 13, 2014 21:37
Test executed in comparison for Sauce Labs, Browserstack, Selenium Grid 2, and a Distributed Build
require 'selenium-webdriver'
require 'spec_helper.rb'
describe 'Selenium Sample' do
it 'drives the example', :group_1 => true do
@logger.info 'Entering Aaron Humerickhouse into name_element'
name_element = @driver.find_element id: 'entry_1000000'
name_element.send_keys "Aaron Humerickhouse"
@logger.info 'Filling in story_element'
@aaronhumerickhouse
aaronhumerickhouse / gist:f9f17ad6b47815bbc0ed
Last active August 29, 2015 14:08
Browserstack failing test
require 'selenium-webdriver'
require 'spec_helper.rb'
#@logger, @wait, and @driver are all defined in spec_helper
describe 'Selenium Sample' do
it 'drives the example', :group_1 => true do
@logger.info 'Entering Aaron Humerickhouse into name_element'
@wait.until { @name_element = @driver.find_element id: 'entry_1000000' }
@name_element.send_keys "Aaron Humerickhouse"
A problem occurred while processing the request. Please check our bug tracker to see if a similar problem has already been reported. If it is already reported, please vote and put a comment on it to let us gauge the impact of the problem. If you think this is a new issue, please file a new issue. When you file an issue, make sure to add the entire stack trace, along with the version of Jenkins and relevant plugins. The users list might be also useful in understanding what has happened.
Stack trace
javax.servlet.ServletException: java.lang.NoClassDefFoundError: hudson/maven/reporters/SurefireAggregatedReport
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:795)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:875)
at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:249)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:745)
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
@aaronhumerickhouse
aaronhumerickhouse / parallel_rspec.rb
Last active August 29, 2015 14:07
Parallel execution for RSpec and Browserstack
desc 'Runs Selenium Tests in browserstack in parallel'
task :browserstack_spec_parallel, [:opts] do |t, args|
puts "Running with: #{@browser.inspect}"
setup_browserstack_variables(@browser)
begin
# Get all files
pattern = args[:opts].split('--pattern')[-1].split(' ')[0].gsub('"', '')
test_files = FileList[pattern].shuffle