Automation Using Coded UI Test
Coded UI Test is a new feature introduced by Microsoft for UI Automation. The automated tests created by CUIT used for the functionality Test Automation Framework Using Coded UI Test.
Test Automation Framework Using Coded UI Test
This tool, we started exploring its ‘Record and Playback’ feature. A very simple test case initiated effort following steps
- Launch Internet Explorer
- Navigate to www.google.com
- Search for “Code UI Test”
Confirm the result returned “How to: Create a Coded UI Test” link. It generated huge code for such a simple test case. the Record and Playback process highlighted the strengths of this tool. The well-structured code and powerful element identification mechanism caught our attention.
Playback Engine Performs Coded UI Test
The CUIT playback engine is also powerful. Playback engine performs duties such as searching for a control and ensuring. the control is visible and ready to act upon. Once the control is ready the engine performs actions such as ‘Click’, ‘Select’, ‘Set a Value’, etc. on it. The recording feature is of course, not enough for building a full-fledged automation suite. But, CUIT’s recording feature helps decide to write own scripts. It helps in getting the proper hierarchy of controls on the page and a set of properties. That used to identify a particular control. We also developed a UI Automation Framework using CUIT. While developing this framework, we experienced that CUIT has got several strengths. Its Recording feature helped us save development time to a good extent.
- The element identification mechanism is powerful
- Uses C#, the compiled language. which comes with its own advantages over the scripting languages
- Works well with The Web as well as Desktop applications
- Strong support for Synchronization. The Playback Engine allows settings such as “WaitForReadyLevel”. which can be either “UIThreadOnly” or “All Threads”. It makes the Test Execution stop until either UI Threads or All threads are ready.
Other supported settings are “Stop on Error”. “Match exact hierarchy”, “Search in minimized window” etc.
- It supports AJAX
- The tests run on Remote Machines with the help of Tests Agents
- Generates huge code for even a small UI operation and maintainability to some extent
- Code Reusability limited. it regenerates code even if it was already generated for a particular action
- It uses almost all the Property Value pairs to identify and locate the UI Controls. which at times seems to affect the performance of the script
Guidelines for Automation using Code UI Test
- Test creation is a time-consuming task, but it is worth going for it. the application under test is pretty stable and large number of tests executed
- it is not worth putting efforts in generating Test Scripts for an application. which has to change functionality
- this used for The Web as well as Windows applications. It supports,
- Silver light
The advantages and reliability of the scripts, CUIT appears for the UI Automation. There are other areas to explore.