UI tests allows developers to automate important end-to-end scenarios which can replace the manual regression tests and can be used to provide early feedback on the regression set. While these tests are easy to create using frameworks like CodedUI/ Selenium, one of the major challenges teams faces is to ensure that these tests remain resilient and can be easily maintainable along with the application code. The paper focuses on some of the practices/ patterns that can be used while creating UI automated tests using the CodedUI framework for web applications.
Like the actual production code, test code also has to be used for a long term and maintainable. The idea is to use the same object oriented principles and practices used in programming code for test code also. You should make use of the SOLID principles and other design patterns to create test code if it has to be useful in the long term. In this paper we’ll see some of the useful techniques that can be used for structuring the code of the automation tests, along with some tips that can be used to make the tests efficient. The examples used are based on CodedUI, but the concepts can be adapted and used in any similar UI automation framework.
The whitepaper addresses topics like
- Extension methods on CodedUI objects
- Using page objects pattern for cleaner code
- Using fluent api for better readability
- Page factories to create page objects
- Reusing the browser window object for faster tests
- Enabling tracing and HtmlLogger for better debugging and error logging
You can download the whitepaper from the link http://1drv.ms/1OcMP69