SlideShare a Scribd company logo
1 of 32
Download to read offline
Selenium for Pythonistas
Add real browsers to your Utility Belt!
sso@saucelabs - @santiycr - Sauce Labs
Who's this dude?
Santiago Suarez Ordoñez
Lead Backend Developer - Sauce Labs
Committer - Selenium Project
6+ years on Selenium and Python
How about Sauce Labs?
Browsers in the cloud
Test mobile and web apps in parallel
+150 OS/Browser platforms
Videos, screenshots, logs, badges, FLOSS
Agenda
Selenium is just a library
Testing best practices
Selenium best practices
Advanced features
Debugging
Q&A
Selenium
History and Goals
How do I use it?
Demo!
What people use it for?
Common use cases for real browsers
Let's focus on testing
That's what you're here for
DRY
That's what you're here for
MOCK ALL THE THINGS!!
If you didn't write it, don't rely on it
Write small tests
Less 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)
Run tests automatically
CI, pre-commit, CD, monitoring
Keep your build green
100% green is the only green
Make writing tests easy
If it takes > 30 min, I'm not gonna do it
Now regarding Selenium
There's lots of Selenium best practices
Do Not Use Selenium!
No, seriously!
Generate application state
The UI is the slowest path to any state in
your app
Use Guinea Pigs
Test complex widgets out of app workflows
Parallelize
Browsers are slow and bulky.
Throw hardware at the problem.
Use Page Object Models
They are just code abstractions, you know?
Use Javascript
execute_script("window.antigravity")
Use waits in your tests
Implicit and Explicit waits will get you 90% there
Debugging failures
Consumes 99% of your time while working
with Selenium
Appium
Questions?
Hot Sauce anyone?
sso@saucelabs - @santiycr - Sauce Labs
Thanks!

More Related Content

Similar to Selenium for pythonistas

Selenium: What Is It Good For
Selenium: What Is It Good ForSelenium: What Is It Good For
Selenium: What Is It Good For
Allan Chappell
 
Creative JD-Qualty Assurance (1)
Creative JD-Qualty Assurance (1)Creative JD-Qualty Assurance (1)
Creative JD-Qualty Assurance (1)
SHWETA AWASTHI
 
Improve Development Process with Open Source Software
Improve Development Process with Open Source SoftwareImprove Development Process with Open Source Software
Improve Development Process with Open Source Software
elliando dias
 

Similar to Selenium for pythonistas (20)

10 Useful Testing Tools for Open Source Projects @ TuxCon 2015
10 Useful Testing Tools for Open Source Projects @ TuxCon 201510 Useful Testing Tools for Open Source Projects @ TuxCon 2015
10 Useful Testing Tools for Open Source Projects @ TuxCon 2015
 
How to Get Started with Cypress
How to Get Started with CypressHow to Get Started with Cypress
How to Get Started with Cypress
 
How to Get Started with Cypress
How to Get Started with CypressHow to Get Started with Cypress
How to Get Started with Cypress
 
Continuous Testing in the Cloud
Continuous Testing in the CloudContinuous Testing in the Cloud
Continuous Testing in the Cloud
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With Selenium
 
Selenium ui paradigm - DDD North 2
Selenium ui paradigm - DDD North 2Selenium ui paradigm - DDD North 2
Selenium ui paradigm - DDD North 2
 
Dev ops
Dev opsDev ops
Dev ops
 
10 practices that every developer needs to start right now
10 practices that every developer needs to start right now10 practices that every developer needs to start right now
10 practices that every developer needs to start right now
 
Automated tests
Automated testsAutomated tests
Automated tests
 
Graceful Failure with Selenium and Continuous Integration
Graceful Failure with Selenium and Continuous IntegrationGraceful Failure with Selenium and Continuous Integration
Graceful Failure with Selenium and Continuous Integration
 
Automation With Selenium
Automation With SeleniumAutomation With Selenium
Automation With Selenium
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation
 
Selenium: What Is It Good For
Selenium: What Is It Good ForSelenium: What Is It Good For
Selenium: What Is It Good For
 
Shift left-csun-sagar-barbhaya
Shift left-csun-sagar-barbhayaShift left-csun-sagar-barbhaya
Shift left-csun-sagar-barbhaya
 
Creative JD
Creative JDCreative JD
Creative JD
 
Creative JD-Qualty Assurance (1)
Creative JD-Qualty Assurance (1)Creative JD-Qualty Assurance (1)
Creative JD-Qualty Assurance (1)
 
Testing the way it should be
Testing the way it should beTesting the way it should be
Testing the way it should be
 
Selenium
SeleniumSelenium
Selenium
 
Improve Development Process with Open Source Software
Improve Development Process with Open Source SoftwareImprove Development Process with Open Source Software
Improve Development Process with Open Source Software
 
BCS Selenium Workshop
BCS Selenium WorkshopBCS Selenium Workshop
BCS Selenium Workshop
 

Recently uploaded

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Selenium for pythonistas