12. www.ultimateqa.com
20
5
4
Poll: How many tests can you run per day that will give the correct result with 95%
accuracy?
1212
2
3
2501 - 1000
1001 - 5000
5000+
101 - 500
51 - 100
0 - 50
13. www.ultimateqa.com 1313
Flaky tests (6)
Lack of
knowledge (6)
Framework (6)
Synchronization
(4)
Other, one off
issues
Poll: What is a problem that you have with test automation?
19. www.ultimateqa.com
Record and Replay: How many tests need to be updated due to a change
in AUT?
1919
How many tests
need to be changed?
Driver
Initialization
Url
Locators
User
names/password
s
Synchronization
issues
Change
Agents
All
All
All
All
All
25. www.ultimateqa.com 25
Page Object Pattern
Use your code to interact with the application page
just like you would interact with it manually
Page.ClickStartHereButton()
Page.GoToVideoTutorials()
36. www.ultimateqa.com
Benefits
3636
A change in an unrelated functionality will not break 2 functionalities
Changing pizza baking functionality is not going to break how the store
delivers the pizza
40. www.ultimateqa.com
Conclusions
4040
Automation
Success
Write your code to prepare
for inevitable change
GUI Automation is hard
A fantastic step towards test
stability
Start using Page Objects
Duplication is the enemy
Remove duplication
Classes should do one thing
only
Follow Single Responsibility Principle
Tests are more readable
Classes are smaller
Separate large page
objects
Start Here
41. www.ultimateqa.com
Resources
4141
• Code and Slide Deck - http://wp.me/P7absY-8j
• Martin, Robert C.. Clean Code: A Handbook of Agile Software Craftsmanship
(Kindle Locations 4076-4077). Pearson Education. Kindle Edition.
• Selenium Wiki on Page Objects
• Martin Fowler on Page Objects
• Dave Haeffner on Page Objects
43. www.ultimateqa.com 43
Step 1: Debug Your Code
Remove code and start again
Ctrl + Y
Ctrl + Z
Restart
OpenQA.Selenium.WebDriverException:
Cannot find Firefox binary in PATH or
default install locations. Make sure Firefox
is installed. OS appears to be: Vista
Read Error Message in
IDE
Pull my code into your IDE
and use a Diff tool.
Use Notepad++ Compare
plugin
Compare to my Code
44. www.ultimateqa.com 44
Step 2: Check My Blog
Selenium errors
Search Blog
http://www.ultimateqa.com/common-
selenium-webdriver-errors-fix/
Go Here
46. www.ultimateqa.com 46
Step 4: Ask Good Questions
No need to be upset
It’s a common problem
Be Positive
http://www.ultimateqa.com/common-
selenium-webdriver-errors-fix/
Go Here
If you want help, make it easy
for the person to help you
Concise, Specific
Be thankful that someone took
time to answer your question
Give Thanks