'How to create a general library for CodedUI test in VS2010?
How can I create a general library for Coded UI tests?
Let's assume that you have common operations such as Launching browser, Login, navigating to a page, clicking on a HTML link and Closing the browser. All these activities can be used in all different test cases. Hence you will not code (record) this option again and again for each single test. If we record all these common actions for each test, the maintenance will become a nightmare, when some link/icon/title changes.
How can we create a common library (something similar to DLL) that all tests referring to it and use it for common activity?
Solution 1:[1]
I finally was able to manage that.
There are two possibilities in order to address this issue. Before listing both approaches, we need to create (a) coded UI Test(s), which include(s) the generic and basic functionalities. For example the common tasks may be opening browser, login and closing the browser. All these kind of common functionalities can go to a coded UI test (it may be several tests based on the requirements). The created UI Test is basically a DLL. Now we have two possibilities:
Adding the created UI test as reference into the new coded UI test or
Creating a new test and inheriting from the generic one.
In such a way we can minimize our maintenance in long term and modulize the whole automation approach.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | TylerH |
