Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Making cross browser tests beautiful (v2 2017)

95 views

Published on

How many times have your Selenium test suites run beautifully on one browser, only to fail when run in any other browser? This is an extremely common problem faced when incorporating cross-browser tests into your test runs. Not all browser drivers are created equally, but that doesn’t mean you can’t create a robust suite of cross-browser tests.

This presentation shares strategies for making cross-browser tests invincible. It focuses on topics such as using as choosing the best locators for all browsers, explicit vs. implicit waits and how to leverage cloud-based testing tools.

This presentation was given at O'Reilly Open Source Convention in May 2017.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Making cross browser tests beautiful (v2 2017)

  1. 1. MAKING CROSS-BROWSER TESTS B f
  2. 2. Ask me about: ● Continuous deployment ● Scaling automation ● Life @ startups
  3. 3. ● WHY ● HOW ● PROBLEMS ● SOLUTIONS ● LESSONS LEARNED A
  4. 4. WHAT DO YOU WANT TO GET OUT OF THIS SESSION?
  5. 5. WHY ?
  6. 6. ● Increase confidence your app works in all browsers ● Can easily test changes in browsers ● Save time from manually testing features
  7. 7. HOW ?
  8. 8. ● Answer the following questions: ○ Which browsers will be supported? ○ What is the most important workflow to test? ○ How will the tests be run?
  9. 9. Write automated tests for a student loan refinance application TASK:
  10. 10. Don’t know how application works in other browsers PROBLEM:
  11. 11. Implement automated cross-browser tests SOLUTION:
  12. 12. Step 1: Decide Supported Browsers
  13. 13. Step 1: Decide Supported Browsers
  14. 14. Step 2: Decide what to automate ● What is the most crucial workflow to automate?
  15. 15. Step 3: Decide how to run tests
  16. 16. Step 3: Decide how to run tests
  17. 17. Step 4: Write some tests
  18. 18. IT SHOULD BE AS EASY AS CHANGING THE DRIVER, RIGHT?
  19. 19. PAGE ELEMENTS PROBLEM # 1
  20. 20. ● Cannot interact with elements in the same way across browsers ● Dropdowns, radio buttons and checkboxes are tricky
  21. 21. Element is not clickable
  22. 22. Alternate clicking methods
  23. 23. TIMING ISSUES PROBLEM # 2
  24. 24. ● Need to wait for elements…. ● Running tests locally vs running remotely
  25. 25. No Such Element
  26. 26. IMPLICIT WAITS Wait for a set amount of time
  27. 27. EXPLICIT WAITS Wait for an event up until a certain amount of time
  28. 28. DRIVER CAPABILITIES PROBLEM # 3
  29. 29. ● Drivers are managed separately ● Native capabilities differ ● Same functionality isn’t always available
  30. 30. FILE UPLOAD
  31. 31. The Safari Driver is implemented in JS and does not have the privileges necessary to manipulate an <input type = “file”> element. Therefore, the SafariDriver does not support file uploads.
  32. 32. RESOLUTION
  33. 33. ● Maximize browser window ● Set a specific resolution at run-time ● Scroll an element into view
  34. 34. LESSONS LEARNED
  35. 35. START TESTING EARLY
  36. 36. MAKE YOUR TEST SCRIPTS UNIVERSAL
  37. 37. USE WAITS AS NEEDED
  38. 38. Run tests in CI regularly
  39. 39. QUESTIONS? LinkedIn: meaghan-lewis Twitter: @iammeaghanlewis Email: meaghan@lever.co

×