seleniumcamp 2015 andrii soldatenko
TRANSCRIPT
High performance Functional tests
based on Selenium
Andrii Soldatenko 27-28 February 2015
@a_soldatenko
About me:• Lead QA Automation Engineer at
• Backend Python Developer at
• Speaker at PyCon Ukraine 2014
• Speaker at PyCon Belarus 2015
• @a_soldatenko
Test Automation Pyramid
from http://martinfowler.com/bliki/TestPyramid.html
What is Test Execution Time?
• Faster Tests Mean Faster Development
• Slow Tests Don’t Get Run as Often
How to decrease test execution time?
“Man is a tool-using animal. Without tools he is nothing, with tools he is all.“ - Thomas Carlyle
xUnit in Pythonparallel
execution pluginsnativetest
coverage
unittest NO NO NO
YES YES YES
YES YES NO
Use Selenium with PhantomJS
Ghost Driver
https://github.com/ariya/phantomjs/
Approach Execution Time % num
processes
Selenium WebDriver 22.76 sec 100% 1
Selenium + py.test 9.24 sec 40% 4
Selenium + PhantomJS 15.55 sec 68% 1
Selenium + PhantomJS 9.98 sec 43% 4
Selenium + PhantomJS + Requests 10.9 sec 47% 1
Selenium + PhantomJS + Requests 6.1 sec 26% 4
Final Thoughts
• Don’t test constants
• Avoid double-testing functionality
• Try to test behavior rather than implementation
• Use Continuous Integration
• Slow tests kill productivity
• Use explicit rather than implicit waits and wait pattern
Thank You
@a_soldatenko
http://asoldatenko.com