SeTipsTricks Java Dave Haeffer
SeTipsTricks Java Dave Haeffer
http://ElementalSelenium.com
http://the-internet.herokuapp.com/
Headless
http://se.tips/all-headless-browsers
Benefits:
- Speed
- Maintenance
- Screenshotting
Headless w/ Xvfb
http://elementalselenium.com/tips/38-headless
NOTE
- display port collisions
- use unique values
- e.g., CI build number
- e.g., xvfb-run -a
Headless w/ GhostDriver
http://elementalselenium.com/tips/46-headless-ghostdriver
http://phantomjs.org/
Option 1
Step 1 - Download PhantomJS
http://phantomjs.org/download.html
Step 2 - Start PhantomJS w/ WebDriver flag
Option 2
Visual Testing
Managing complexity
False positives
In pom.xml
Getting Started
http://se.tips/se-visual-2
http://se.tips/se-visual-3
http://se.tips/se-visual-4
http://se.tips/se-visual-5
Selenium
Browser
Proxy
Server
Application
Under
Test
http://bmp.lightbody.net/
Configuration
Blacklisting
http://elementalselenium.com/tips/66-blacklist
Configuration
Load Testing
http://elementalselenium.com/tips/68-load-testing-revisited
Configuration
https://flood.io/har2jmx
http://se.tips/selenium-to-jmeter
Option 3: JavaScript
Option 3: JavaScript
Option 3: JavaScript
Forgot Password
http://elementalselenium.com/tips/43-forgot-password
Configuration
http://se.tips/watirmelon-email-testing
A/B Testing
http://elementalselenium.com/tips/12-opt-out-of-ab-tests
http://the-internet.herokuapp.com/abtest
Configuration
forging a cookie
File Management
Uploading a File
http://elementalselenium.com/tips/1-upload-a-file
Options
http://se.tips/grid-file-upload
Downloading a File
http://elementalselenium.com/tips/2-download-a-file
http://elementalselenium.com/tips/8-download-a-file-revisited
http://elementalselenium.com/tips/15-download-secure-files
Two approaches
1.Configure Selenium to download to local disk, and
delete the file when done
2.Use an HTTP library, perform a HEAD request, and
check the headers for the correct content type &
length.
Why #2?
An order of magnitude faster
No need to download the file
With Selenium
With Selenium
Additional Output
Highlight Elements
http://elementalselenium.com/tips/65-highlight-elements
Growl Notifications
http://elementalselenium.com/tips/53-growl
Selenium Bootcamp
http://se.tips/se-bootcamp
http://se.tips/oss-tip-code
Selenium Guidebook
http://se.tips/se-guidebook
http://seleniumconf.co.uk