Cross browser Testing JavaScript


Published on

One mistake many people make is running their selenium test suites with every browser combination... you don't need to! Rendering problems are probably the biggest cross browser compatibility issue, and you can't actually test for these with Functional Tests. So by running Selenium tests across many browsers you are really testing JavaScript and DOM compatibility.

Running our Selenium tests across many browsers was our JavaScript compatibility strategy, but it proved inefficient as we ended up with bugs in Internet Explorer; how embarrassing!

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Start-upFollow Learn Start-upBuilt a MVP on top of JIRA – Consequence is customers install on there own hardwareWe pratitice CD during product development and always looking to get feature into customers handsMobile app developers may face similar issues to us as there are many parallels
  • Cross browser Testing JavaScript

    1. 1. Cross Browser testing JavaScript Alan Parkinson CEO, Hindsight Software Ltd @alan_parkinson
    2. 2. You don’t need to run your Selenium Test suite with every browser* The Truth
    3. 3. • No visual testing • Low JavaScript code coverage • Costly to improve coverage Rendering Compatibility JavaScript/DOM Compatibility What do we achieve?
    4. 4. • JavaScript and DOM compatibility • Good code coverage • Reusing a development artifact Run all JavaScript unit tests cross browser Simple Answer
    5. 5. • Average Test: 8 Seconds • Test Suite: 5 minutes • Average Test: 0.1 seconds • Test suite: 11 seconds Functional Tests JavaScript Unit Tests Looking at the numbers
    6. 6. Do we meet our compatibility objective? Code Coverage has a use
    7. 7. • Too many JavaScript files • Order of loading files Not everything will be picked up by Unit Tests *The qualifier Only run critical functional tests cross- browser
    8. 8. JAVASCRIPT TEST RUNNERS Reusing your Selenium infrastructure
    9. 9. • Testing Framework Agnostic • Continuous Integration • Code coverage with Instanbul • Launch Browsers • Manually connect browsers Spectacular Test Runner for JavaScript Real Browsers Karma
    10. 10. • Connects Remote WebDriver Instances • Selenium Grid 2 • Supports Desired Capabilities Reusing your Selenium Infrastructure Karma WebDriver Launcher
    11. 11. Karma in action $ npm install -g karma $ npm install -g karma-webdriver-launcher
    12. 12. Continuous Integration Override karma.conf.js from the command line singleRun: true reporters: [‘junit’]
    13. 13. • Code Coverage • Feedback time • Meeting our objective - Compatibility • Karma Runner • Use your existing WebDriver infrastructure • Use code coverage to validate the majority of your code is compatibility tested. Functional tests have poor performance: Cross-browser unit test JavaScript Summary
    14. 14. webdriver-example Thank you Alan Parkinson @alan_parkinson