Discouraged practices for Selenium automation
The Selenium team publishes on the official site 2 lists of practices:
1. the encouraged practices
2. the discouraged practices
These are the encouraged practices:
2. Domain specific language
3. Generating application state
4. Mock external services
5. Improved reporting
6. Avoid sharing state
7. Tips on working with locators
8. Test independency
9. Consider using a fluent API
10. Fresh browser per test
And the discouraged behaviors:
1. Captchas
2. File downloads
3. HTTP response codes
4. Gmail, email and Facebook logins
5. Test dependency
6. Performance testing
7. Link spidering
8. Two Factor Authentication
You may think that the list of discouraged practices is quite small.
Because, in reality, not many sites use on non-production environments capcha, 2 factor authentication, social media login.
Performance testing with Selenium scripts is rare.
Link spidering with Selenium tests is rare.
Checking HTTP response codes is also rare and so are file downloads.
What is left as discouraged behavior? Test dependency, the tests needing to be independent.
But, if you look at the encouraged practices, not using such a practice is also a discouraged practice. Because the Selenium team suggests using them instead of not using.
This is similar to
if not eating sugar is recommended, eating sugar is not recommended
if exercising is recommended, not exercising is not recommended
if sleeping minimum 7 hours is recommended, sleeping less is not recommended
if not eating processed food is recommended, eating processed food is not recommended
So, the list of discouraged practices is
1. not using Page object models
2. not using Domain specific language
3. Generating application state
4. not Mocking external services
5. not using Improved reporting
6. not Avoiding sharing state
7. Using horrific locators (Tips on working with locators)
9. not using Test independency
10. not using a fluent API
11. not using a Fresh browser per test
Thanks for reading.