- Selenium 3 & geckodriver support
- Updated to latest version of supporting libraries
- Updated code examples for better Python 3 compliance
- Fixed errata
- Added collection of Python tips (as an accompanying PDF e-book)
This file contains 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
""" | |
The element lookup for the assertion fails. | |
Adding a sleep of 0.5 seconds before it makes it work. | |
But this example worked without the sleep in 2.53.1 with Firefox 46. | |
Using: | |
- selenium 3.0.2 | |
- geckodriver 11.0.1 | |
- Firefox 50.0.1 | |
""" |
This file contains 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
$(document).ready(function() { | |
// get distinct_id from URL param | |
function getQueryParam(param) { | |
location.search.substr(1) | |
.split("&") | |
.some(function(item) { | |
return item.split("=")[0] == param && (param = item.split("=")[1]) | |
}) | |
return param | |
} |
This file contains 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
test.afterEach(function() { | |
var testName = this.currentTest.fullTitle(), | |
testResult = (this.currentTest.state === 'passed') ? true : false; | |
driver.executeScript('sauce:job-name=' + testName); | |
driver.executeScript('sauce:job-result=' + testResult); | |
driver.quit(); | |
}); |
This file contains 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
require 'selenium-webdriver' | |
require 'rspec/expectations' | |
include RSpec::Matchers | |
require 'eyes_selenium' | |
def setup | |
@eyes = Applitools::Eyes.new | |
@eyes.api_key = ENV['APPLITOOLS_API_KEY'] | |
caps = Selenium::WebDriver::Remote::Capabilities.internet_explorer | |
caps.version = '8' |
This file contains 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
require 'selenium-webdriver' | |
require 'rspec/expectations' | |
include RSpec::Matchers | |
driver = Selenium::WebDriver.for :firefox | |
driver.get 'http://the-internet.herokuapp.com/exit_intent' | |
driver.action.move_by(5000, 0).perform | |
Selenium::WebDriver::Wait.new(timeout: 5).until { | |
driver.find_element(class: 'modal-body').displayed? |
This file contains 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
class BasePage | |
def initialize(driver) | |
@driver = driver | |
driver.get ENV['base_url'] | |
end | |
def visit(url_path) | |
driver.get ENV['base_url'] + url_path | |
end | |
# ... |
This file contains 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
require 'selenium-webdriver' | |
@driver1 = Selenium::WebDriver.for :firefox | |
@driver2 = Selenium::WebDriver.for :firefox | |
@driver1.get 'http://google.com' | |
@driver2.get 'http://duckduckgo.com/' | |
@driver1.quit | |
@driver2.quit |
This file contains 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
source 'https://rubygems.org' | |
gem 'selenium-webdriver', '~> 2.46.0' |
This file contains 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
source 'https://rubygems.org' | |
gem 'selenium-webdriver', '~> 2.45.0' | |
gem 'eyes_selenium', '~> 2.15.0' | |
gem 'rspec', '~> 3.2.0' | |
gem 'rake', '~> 10.4.2' |