python for blackbox testers

26
Presented at PyconSG on 14th June 2013

Upload: sajnikanth-suriyanarayanan

Post on 20-Jun-2015

1.653 views

Category:

Technology


0 download

DESCRIPTION

This is my experience as a non-technical, black box test engineer in a software development team. I try to explore answers to questions like: What are my strengths? Were my strengths becoming my weaknesses? Writing "code" is for developers; How can I? Yeah, but why python? * Was it worth the effort?

TRANSCRIPT

Page 1: Python for blackbox testers

Presented at PyconSG on 14th June 2013

Page 2: Python for blackbox testers

● Coastal GeoScientist and Civil Engineer● 10+ years in Software Quality Assurance

and Functional Testing● HP Certified Professional in Quality Center● Lead Quality Assurance at Vistaprint● Contributor to Holmium Core● http://sajnikanth.com

About me

Page 3: Python for blackbox testers

● Background to black-box testing● Manual vs Automated testing● Why python?● selenium and other uses● Lessons Learned

Contents

Page 4: Python for blackbox testers

Black-box tester?

Page 5: Python for blackbox testers

Source - http://innovation.lv/ino2/publications/leonardo_manual/en/www.innosupport.net/webhelp/wso/index.cfm@fuseactionlearnl_id3808pl_id3554.htm

● Prepare test plans and test cases● Test the application● Find and record defects● Re-test● Regression test

Black-box tester's task list

Page 6: Python for blackbox testers

Qualities of a good black-box tester

Page 7: Python for blackbox testers

How many test cases do you see?

What's the problem?

5 * 3 * 3 * 2 * 2 = 180Test Cases * Browsers * Countries * Languages * Environment

Time to test on a few platforms?Good luck sucker!!

Page 8: Python for blackbox testers

● Repetitive manual regression = boring● Low test coverage● No common language● Ever growing Test Suites● Testing becomes a bottleneck● QA bites the bullet

What's the problem?

Source -http://en.wikipedia.org/wiki/Infinite_monkey_theorem

Page 9: Python for blackbox testers

● "Fail fast; fail often" - Martin Fowler● Integration / Functional / Performance● Building block for continuous integration and

deployment● Higher Return on investment

Automated testing

Page 10: Python for blackbox testers

QTP to the rescue

● Expensive● Proprietary● Windows-centric● "Ageing" community

● Familiar (HP Certified after all)● Popular● Supports Record and Play

I think it is time for QTP to die - http://paulhammant.com/blog/die-qtp-die.html/

Page 11: Python for blackbox testers

python?

● Easy to setup● Readable code (easy for beginners)

○ forced indentations; better for the team○ consistency

● open source; active community / library

Page 12: Python for blackbox testers

OK; Getting back to the problem5 * 3 * 3 * 2 * 2 = 180Test Cases * Browsers * Countries * Languages * Environment

Time to test on a few platforms?

Page 13: Python for blackbox testers

● Record and Play (Firefox)● Multiple browsers● Mobile Support● Multiple ways to locate an element● Screenshots ● ...

Selenium Features

Page 14: Python for blackbox testers

● Test APIs● Write scripts for simple UI tests● Create test data● Test Suites● Performance Testing● ...

Working with python

Page 15: Python for blackbox testers

Lessons learned

Page 16: Python for blackbox testers

Lessons learned

Web dev changes conventions - intrologin-name, intrologin-password etc.

Page 17: Python for blackbox testers

1. Use Page ObjectsPageObjects by Adam Goucher -

http://www.pushtotest.com/create-robust-selenium-tests-with-pageobjects

Lessons learned

Page 18: Python for blackbox testers
Page 19: Python for blackbox testers

Lessons learned

Page 20: Python for blackbox testers

2. Wait instead of SleepExplicit and Implicit Waits -

http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp

Lessons learned

Page 21: Python for blackbox testers

3. pick

nose is nicer testing for python - https://nose.readthedocs.org/en/latest/

● Organize tests better● Run selected tests● Plugin Architecture● List all tests● Test Runner (less boilerplate code)

Lessons learned

Page 22: Python for blackbox testers

● Run 30 tests on Firefox○ about 12 minutes

Lessons learned

● Run 30 tests on a Headless browser○ about 7 minutes

Page 23: Python for blackbox testers

4. use headless

● step toward Continuous Integration○ jenkins / teamcity / Travis CI are phantomjs-ready

● better performance than Firefox / Chrome● works without GUI

○ no interruption○ ec2 micro instance○ vagrant

Lessons learned

Page 24: Python for blackbox testers

● https://holmiumcore.readthedocs.org● plugin for nosetests

○ developed by Ali-Akber Saifee■ http://ali.indydevs.org/

● Page object definitions made easy● Other options:

○ Specify environment○ Select browsers○ Run tests remotely

Introducing Holmium

Page 25: Python for blackbox testers

nosetests tests/vistamobi_tests.py --with-holmium--holmium-browser=firefox--holmium-environment=staging--holmium-useragent=iphone

Page 26: Python for blackbox testers

View this presentation from here - http://sajnikanth.com

How many software testers does it take to change a lightbulb?

None; testers just report that the room is dark.

Questions?