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

Preview:

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.

Citation preview

Noah Sussman Selenium Conf 2012, London

#SEConf • @noahsussman

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

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.

Chad Dickerson Describes the History of Etsy

1999

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.

2000

In 2006, Ben Strawbridge introduced me to Selenium.

2006

Selenium Core was nothing but JavaScript and Markup

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.

INTEGRATION HELL

We decoupled the UI from the services layer.

We ensured all the HTML was valid.

We treated the DOM structure as a contract.

UI AS CONTRACT

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

Hacking Selenium requires some serious programming chops.

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.

Detectable errors tend not to be subtle.

In 2009 I worked on several large enterprise projects.

Hundreds of tests in HTML files

Took all day to run by hand

Enormous maintenance cost

No automation

No visibility

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

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

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

It was the simplest thing that could possibly work.

“What did it just do?”

“Why does it say Element Not Found?”

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

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.

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.

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.

We can rapidly detect and fix problems in production.

Every Etsy admin gets to help with testing and debugging.

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.

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.

First, do the simplest thing that can possibly work.

That’s probably all you need.

Recommended