A Pycon Canada last weekend I did a 20 minute talk on WebDriver. You can play along with the code. My usual jokes, etc.

  1. Use Page Objects! – There are a lot of examples (even in Python). This repo has one take on the pattern, but there are lots of other ones. Explore to find the that resonates most with you. And hen adapt it to your own needs.
  2. Javascript Executor – This is how we are going to have to automate the flood of JS Widgets and … canvas. Ugh. Canvas. The cool thing about the executor is that it can take a WebDriver element as an argument and the ‘right’ thing happens to morph it to a native JS object. Get used to this folks…
  3. Proxy all the things – A good idea is to run your automation through a scriptable proxy to be able to do things like blacklist Facebook and Twitter integrations (and thus drastically improve the speed of your app)