Here is the list of general problems of testing Web applications through UI:
- Maintainability
- Hard to create for non-programmers
- Hard to handle AJAX
- Hard to handle persistence
- Erratic tests
- Testing takes too much time
- Hard to understand test flow
- Hard to understand why test failed
Project design-of-selenium-tests-for-asp-net was created to show how to create automated UI tests for ASP.NET application using Selenium and minify influence of these problems. Description of how each particular issue can be avoided:
Problem: Maintainability
- Abstraction layers (Page Object, Flow)
- Code generation - Part 1 and Part 2
- Continuous integration
- Processes (Do not allow commit when build fails)
Problem: Hard to create for non-programmers
- Domain Specific Language and lightweight editor/runner
Problem: Hard to handle AJAX
Problem: Hard to handle persistence
- Fresh test fixture
- Use unique data for each test
Problem: Erratic tests
Problem: Testing takes too much time
Problem: Hard to understand test flow
- Abstraction layers (Page Object, Flow)
- Think about future generations :)
Problem: Hard to understand why test failed
- Special patterns (Navigator)
- Meaningful messages
- Run time analysis
3 comments:
I love your posts about Selenium in combination with .Net!
Do you also know any patterns for setting up databases to a deterministic state before each test ( given the fact that selenium grid is running tests in parallel on SUT )
1) use separate instance of database for each test. Pretty bad for tests scalability - max count of parallel tests = count of available databases.
2) Separate in-memory database (like SQL Lite) for each test. Uses too much resources and doesn't ensure that test will work on real database.
3) Using fakes instead of real databases - requres advanced coding in SUT and doesn't ensure that test will work on real database.
Personally I do not like each of mentioned methods due to its limitations and try to create independent tests.
Hope you could have more time to write more about the Selenium 2.0(webdriver) with C#.
Post a Comment