My slide deck from the Sept 2010 Dev4Dev's talk. The slides are pretty basic just an introduction to the topic, the meat is in the demo's (and some hidden slides).
Dev4Dev's is a Microsoft event where you only get 20min to present, which is why this is so short.
More details on this at http://www.sadev.co.za
2. Setup Visual Studio with BreakWPF Visual Studio clean IIS Express running for Xbox 360 Super Store Firefox & IE – make sure the cart is empty! Copy TestValues.xml to desktop ZoomIT
5. UIMap.Designer.cs – The two methods there were it sends keys and asserts.Test -> Run -> All tests in solution (Ctrl R,A) – HANDS OFF Show test results
6. Demo 2 – Breaking CUIT Kick off the break wpf app Remove the current files from the test project -> Add new coded ui test -> Record actions -> start recording Click good button -> stop recording -> generate method Add assert of message display test -> generate method -> close builder Close breakwpf and move the buttons around -> run the application Run the test (Ctrl+R,A) -> show it works Close breakwpf and remove the name property from the good button -> run breakwpf -> run test -> BROKEN! Would need to rerecord the system – which is why asserts are separate
7. Demo 3 – Data Driven UI Clean out test project Make sure no IE instances are open Add new coded UI -> record action -> start record Open a new IE instances -> Go to http://localhost:9000 -> Then go to http://localhost:9000/Profile/Logout Click profile -> login -> click catalog -> click add fifa to cart -> change quantity to 2 -> press tab -> click check out PAUSE recording -> Generate code (name: LoginToConfirm) Assert Quantity Cell and Total Cost Cell Inner Text values -> Generate code (name: ValidateResults) Resume recording Click confirm checkout -> click profile -> click logout Pause recording -> generate code (name: cleanup) Close builder Test (menu) -> Windows -> Test View -> Right click on test and go properties -> Set Data Connection String to testvalues.xml Point out attribute Add following code: this.UIMap.LoginToConfirmParams.UIQuantityEditText = TestContext.DataRow["quantity"].ToString();this.UIMap.ValidateResultsExpectedValues.UIItem2CellInnerText = TestContext.DataRow["quantity"].ToString();this.UIMap.ValidateResultsExpectedValues.UIItem119800CellInnerText = TestContext.DataRow["total"].ToString();BrowserWindow.CurrentBrowser = "Firefox"; Press Ctrl+F5 Show test tesults and image
8. Factoids Coded UI tests are available in Premium and Ultimate It uses different kinds of accessibility mechanisms for different tech apps – IEDOM for web apps, MSAA for winforms, UIA for WPF Platforms supported on are available at Gautam’s blog Supports 2 different langs – C# and VB.NET Can construct tests from scratch via handcoding using the APIs – no specialized classes needed The core parts of the engine for Coded UI has been used extensively in DevDiv for writing automated tests since several years – this is a well tested reliable piece of technology Recording in CUIT is intent aware – so, the aggregations are smart enough to guess the intent of users. Eg: LaunchApp Resilience is built into the engine in many ways – smartmatch is one of them. It deconstructs the window title and matches it in parts to deal with title changing windows The VSTLM team uses coded UI tests for their own UI automation and have several hundreds of UI tests that drive Visual Studio and MTM using coded UI Coded UI tests can also employ multiple UI maps to help segregate code by UI components and allow multiple testers to work on them You can run Coded UI as part of your build You cannot record actions if the application is run under different user credentials You can use Win+I to select controls under the mouse
9.
10. It uses different kinds of accessibility mechanisms for different tech apps – IEDOM for web apps, MSAA for winforms, UIA for WPF
13. Can construct tests from scratch via handcoding using the APIs – no specialized classes needed
14. The core parts of the engine for Coded UI has been used extensively in DevDiv for writing automated tests since several years – this is a well tested reliable piece of technology
15. Recording in CUIT is intent aware – so, the aggregations are smart enough to guess the intent of users. Eg: LaunchApp
16. Resilience is built into the engine in many ways – smartmatch is one of them. It deconstructs the window title and matches it in parts to deal with title changing windows
17. The VSTLM team uses coded UI tests for their own UI automation and have several hundreds of UI tests that drive Visual Studio and MTM using coded UI
18.
19. Overture New in Visual Studio 2010! 3 Aspects of Coded UI Coded UIBasics Breaking Coded UI Data Driven Coded UI Please hold questions for the end
20. I came for the money! Coded UI will save you time