Selenium in the enterprise what went right and what went wrong so far - selenium conf 2012 london

35
Noah Sussman Selenium Conf 2012, London #SEConf @noahsussman What went right, what went wrong (so far) Selenium in the Enterprise

description

In 2006 a friend turned me on to a new test harness called Selenium. The framework had little documentation and ran inside a weird, janky frameset. But Selenium had two killer features: you didn’t need Windows administrator privileges to install it and it was the only free GUI-driven regression testing framework for Web sites. Five years later I find myself in the position of having used Selenium in a business context for almost half my career and nearly the entire lifetime of the tool. Selenium’s changed a lot, so have the Web sites it was designed to test, and so has the Web itself. I look forward to talking about how I have helped businesses leverage Selenium to manage change and increase their ability to adapt in the ever-evolving world of eCommerce.

Transcript of Selenium in the enterprise what went right and what went wrong so far - selenium conf 2012 london

Page 1: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

Noah Sussman Selenium Conf 2012, London

#SEConf • @noahsussman

What went right, what went wrong (so far)Selenium in the Enterprise

Page 2: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

Our mission is to empower people to change the way the global economy works. We see a world in which very-very small businesses have much-much more sway in shaping the economy, local living economies are thriving everywhere, and people value authorship and provenance as much as price and convenience. We are bringing heart to commerce and making the world more fair, more sustainable, and more fun.

Page 3: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

Chad Dickerson Describes the History of Etsy

Page 5: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

1999

Page 6: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

Clicking all these links is a waste of my time and it hurts my wrist. There has got to be some way to tell the computer to click everything, without my having to move the mouse.

Page 7: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

2000

Page 8: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

In 2006, Ben Strawbridge introduced me to Selenium.

Page 9: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

2006

Page 10: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

Selenium Core was nothing but JavaScript and Markup

Page 13: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

In 2007, I led my first large enterprise Web project.

UI team geographically separated from services team.

UI development began months in advance of services.

Page 14: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

INTEGRATION HELL

Page 15: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

We decoupled the UI from the services layer.

We ensured all the HTML was valid.

We treated the DOM structure as a contract.

Page 16: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

UI AS CONTRACT

Page 17: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

A frameset wrapped in a proxy server wrapped in an enigma.

Hacking Selenium requires some serious programming chops.

Page 18: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

In 2008 I worked on a green field project.

The UI was constantly in flux. I couldn’t keep up.

So I wrote a Perl script that sniffed for invalid response codes.

To my surprise, the script caught a lot of bugs.

It was the simplest thing that could possibly work.

Page 19: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

Detectable errors tend not to be subtle.

Page 20: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

In 2009 I worked on several large enterprise projects.

Page 21: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

Hundreds of tests in HTML files

Took all day to run by hand

Enormous maintenance cost

No automation

No visibility

Page 22: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

Various attempts were made to convert manual QA steps into automated tests.

Attempts were made to test deep and subtle aspects of the application.

Page 23: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

In the end, I wrote a few small tests for the critical path.

It was the simplest thing that could possibly work.

Page 24: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

“What did it just do?”

“Why does it say Element Not Found?”

“Isn’t this going to fail next time we update the UI?”

Page 25: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

iOS Functional Testing in 2009.

Automation frameworks barely existed.

All I could provide were crash tests.

The crash tests were very helpful to the QA team.

It was the simplest thing that could possibly work.

Page 26: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

A Brief History of the Etsy CI System

Lots of functional tests, some unit tests.

Expensive, slow fixtures.

Written in Python but the stack is PHP.

Page 27: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london
Page 28: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

The Etsy CI System Today

Functional tests mostly replaced with Nagios + StatsD.

Remaining functional tests rewritten in Behat + Mink.

We made it really easy to write unit tests.

Page 29: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

We can rapidly detect and fix problems in production.

Page 30: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

Every Etsy admin gets to help with testing and debugging.

Page 31: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london
Page 32: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

Maintaining a large functional test suite is hard.

Interpreting the results of functional tests is an art.

Often a simple solution is all you need.

Page 33: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

Being able to move fast is more important than being able to prove you are safe from failure.

Failure is inevitable. Recovery is what matters.

Page 34: Selenium in the enterprise   what went right and what went wrong so far - selenium conf 2012 london

First, do the simplest thing that can possibly work.

That’s probably all you need.