This document provides an overview of Selenium testing tools and techniques. It discusses headless testing using Xvfb and PhantomJS. It also covers visual testing with Applitools, using proxy servers like BrowserMob for status codes and performance testing, and emulating mobile devices. Additional topics include growl notifications, file handling, A/B testing, and resources for learning more about Selenium.
2. Who is this person?
• Worked in Test Automation entire career
• Currently Lead Test Automation Engineer for
Revcontent
• Market Leader for Native Advertising
• Worked at Ceridian HCM/FIS/Ceridian HCM
• Windows, Mac, iOS, Android, Window Phone and
Blackberry
3. Revcontent
• Market Leader for Native Advertising
• 2-3 times greater RPM than Competitors
• Related Stories Around the Web
5. !Plagiarized
• These Slides are adapted with permission from Dave
Haeffner’s Selenium Tips & Tricks
• Runs Elemental Selenium bit.ly/se-weekly-tips
• Weekly Tip Newsletter
• Selenium Guidebook bit.ly/se-guidebook
• Title speaks for itself
• Bootcamp bit.ly/se-bootcamp
24. PhantomJS Options
1.Add to path
WebDriver = new PhantomJSDriver();
2.Start with WebDriver Flag
phantomjs --webdriver=8910
3.Pass in Executable Path
Similar to Chromedriver or IEDriverServer
32. With Eyeballs
driver.get(“the-internet.heroku.com/login”);
Eyes eyes = new Eyes();
eyes.setApiKey(apikey);
eyes.CheckWindow(“Login”);
driver.findElement(By.id(“username”)).sendKeys(“tomsmith”);
driver.findElement(By.id(“password”)).sendKeys(“SuperSecretPassword”);
driver.findElement(By.id(“login”)).submit();
eyes.checkWindow(“Logged In”);
33. With Eyeballs
driver.get(“the-internet.heroku.com/login”);
Eyes eyes = new Eyes();
eyes.setApiKey(apikey);
eyes.CheckWindow(“Login”);
driver.findElement(By.id(“username”)).sendKeys(“tomsmith”);
driver.findElement(By.id(“password”)).sendKeys(“SuperSecretPassword”);
driver.findElement(By.id(“login”)).submit();
eyes.checkWindow(“Logged In”);
34. With Eyeballs in Test
Context
driver.get(“the-internet.heroku.com/login”);
eyes.CheckWindow(“Login”);
driver.findElement(By.id(“username”)).sendKeys(“tomsmith”);
driver.findElement(By.id(“password”)).sendKeys(“SuperSecret
Password”);
driver.findElement(By.id(“login”)).submit();
eyes.checkWindow(“Logged In”);
44. Proxy Image Checking
• Get HAR
• HAR = HTTP Archive
• Find all image elements
• Go thru all entries in HAR
• Validate that each image source was not 404
45. HTTP Library
• Mostly same as before
• Use library to make a request to each source
• Validate response = 200
46. JavaScript
• Validate each image has a width
executeScript(“return
arguments[0].complete && typeof
arguments[0].naturalWidth !=
”undefined” &&
arguments[0].naturalWidth > 0”, image)
47. Performance Testing
• HAR = HTTP Archive
• Validate page load times are under SLA
• Bonus
• Send metrics to a dashboard for monitoring