selenium for pythonistas

Post on 06-May-2015

284 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

Talk given for the San Francisco Python Meetup at Yelp on May 8th, 2013. Focused mainly in Selenium and Testing tips.

TRANSCRIPT

Selenium for PythonistasAdd real browsers to your Utility Belt!

sso@saucelabs - @santiycr - Sauce Labs

Who's this dude?

Santiago Suarez OrdoñezLead Backend Developer - Sauce LabsCommitter - Selenium Project6+ years on Selenium and Python

How about Sauce Labs?

Browsers in the cloudTest mobile and web apps in parallel+150 OS/Browser platformsVideos, screenshots, logs, badges, FLOSS

Agenda

Selenium is just a libraryTesting best practicesSelenium best practicesAdvanced featuresDebuggingQ&A

SeleniumHistory and Goals

What people use it for?Common use cases for real browsers

Let's focus on testingThat's what you're here for

DRYThat's what you're here for

MOCK ALL THE THINGS!!If you didn't write it, don't rely on it

Write small testsLess is more

Avoid inter-test dependencies

Independent tests are good!

Tests Start

Test Create Account(User A)

Test Login(User A)

Test Change Password(User A)

Test Close Account(User A)

Keep your build green100% green is the only green

Make writing tests easyIf it takes > 30 min, I'm not gonna do it

Now regarding SeleniumThere's lots of Selenium best practices

Generate application stateThe UI is the slowest path to any state in

your app

Use Guinea PigsTest complex widgets out of app workflows

ParallelizeBrowsers are slow and bulky.

Throw hardware at the problem.

Use Page Object ModelsThey are just code abstractions, you know?

Use Javascriptexecute_script("window.antigravity")

Use waits in your testsImplicit and Explicit waits will get you 90% there

Debugging failuresConsumes 99% of your time while working

with Selenium

Questions?Hot Sauce anyone?

sso@saucelabs - @santiycr - Sauce Labs

Thanks!

top related