Coded UI is a User Interface (UI) Test Automation Tool that comes with Microsoft Visual Studio which can be used to automate our manual, repetitive and regression tests thereby increase productivity of Testing teams.
Cross browser support• Windows 8 X86 Client/Windows 8 X64/Win7 X64/Win7 X86/Win2k8 R2 SP1• IE version - IE9/ classic IE10• Firefox version - 15+• Chrome version - 21+• Visual Studio Ultimate/Premium - VS 2012 RTM + VS 2012 Update 1• Selenium NET Bindings and the Selenium ChromeDriver on Visual Studio Gallery.
Working with CodedUI• 2 ways we can work with CodedUI – Using built-in Test builder • You simply perform the test manually while the CUIT Test Builder runs in the background • The code is generated automatically• Hand-code – Based on “Page Object Model” • Create an Object repository • Write code manually for each object to achieve the task
Why Hand-Coding• Generated code has – Duplicate scripts – Repeated hardcode • Cost lot of time to change code – Unmanaged UI control • One control may be recorded by many times• Hand code – More control over the code – Increase maintainability – Increase readability – Improve sustainability (reusable objects, data driven, constant values in .settings file etc)
Page objects• Within your web apps UI there are areas that your tests interact with.• A Page Object simply models these as objects within the test code. • Reduce duplicated code and if changed %only be applied in one place. “The Page Object pattern represents the screens of your web app as a series of objects”
Identifying objects• Using asserting feature of CodedUI
UI Technologies for searching controls.• Internet Explorer Testing: Uses MSHTML, DOM to retrieve properties and identify controls hosted within the Internet Explorer.• UIA: UI Automation is the new accessibility framework for Microsoft Windows, available on all operating systems that support Windows Presentation Foundation (WPF).• MSAA: This is picked for Winforms Controls, Win32 controls, MFC applications. All the controls that are not picked up by the above two are picked by MSAA.