Making money with Coded UI<br />
Setup<br />Visual Studio with BreakWPF<br />Visual Studio clean<br />IIS Express running for Xbox 360 Super Store<br />Fir...
Demo 1 – Basic<br />File -> New -> Test Project<br />Delete unittest.cs<br />Add new item -> coded ui test<br />Record act...
UIMap.uitest – the XML
UIMap.Designer.cs – The two methods there were it sends keys and asserts.</li></ul>Test -> Run -> All tests in solution (C...
Demo 2 – Breaking CUIT<br />Kick off the break wpf app<br />Remove the current files from the test project -> Add new code...
Upcoming SlideShare
Loading in …5
×

Making money with CodedUI

2,295 views

Published on

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

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,295
On SlideShare
0
From Embeds
0
Number of Embeds
399
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Making money with CodedUI

  1. 1. Making money with Coded UI<br />
  2. 2. Setup<br />Visual Studio with BreakWPF<br />Visual Studio clean<br />IIS Express running for Xbox 360 Super Store<br />Firefox & IE – make sure the cart is empty!<br />Copy TestValues.xml to desktop<br />ZoomIT<br />
  3. 3. Demo 1 – Basic<br />File -> New -> Test Project<br />Delete unittest.cs<br />Add new item -> coded ui test<br />Record actions – explain the control<br />Record on -> start -> calc.exe (point out tooltips) -> put in some calculations into the calc. when done stop recording<br />Click show steps - > click generate method<br />Click the assertions pointer – point to total – then add assert to display text add a list item too.<br />Click generated method and close the builder<br />Tour the code <br /><ul><li>CodedUITest1.cs Test method show the two methods
  4. 4. UIMap.uitest – the XML
  5. 5. UIMap.Designer.cs – The two methods there were it sends keys and asserts.</li></ul>Test -> Run -> All tests in solution (Ctrl R,A) – HANDS OFF<br />Show test results <br />
  6. 6. Demo 2 – Breaking CUIT<br />Kick off the break wpf app<br />Remove the current files from the test project -> Add new coded ui test -> Record actions -> start recording<br />Click good button -> stop recording -> generate method<br />Add assert of message display test -> generate method -> close builder<br />Close breakwpf and move the buttons around -> run the application<br />Run the test (Ctrl+R,A) -> show it works<br />Close breakwpf and remove the name property from the good button -> run breakwpf -> run test -> BROKEN!<br />Would need to rerecord the system – which is why asserts are separate<br />
  7. 7. Demo 3 – Data Driven UI<br />Clean out test project<br />Make sure no IE instances are open<br />Add new coded UI -> record action -> start record<br />Open a new IE instances -> Go to http://localhost:9000 -> Then go to http://localhost:9000/Profile/Logout<br />Click profile -> login -> click catalog -> click add fifa to cart -> change quantity to 2 -> press tab -> click check out<br />PAUSE recording -> Generate code (name: LoginToConfirm)<br />Assert Quantity Cell and Total Cost Cell Inner Text values -> Generate code (name: ValidateResults)<br />Resume recording<br />Click confirm checkout -> click profile -> click logout <br />Pause recording -> generate code (name: cleanup)<br />Close builder<br />Test (menu) -> Windows -> Test View -> Right click on test and go properties -> Set Data Connection String to testvalues.xml<br />Point out attribute<br />Add following code:<br />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";<br />Press Ctrl+F5<br />Show test tesults and image<br />
  8. 8. Factoids<br />Coded UI tests are available in Premium and Ultimate <br />It uses different kinds of accessibility mechanisms for different tech apps – IEDOM for web apps, MSAA for winforms, UIA for WPF <br />Platforms supported on are available at Gautam’s blog <br />Supports 2 different langs – C# and VB.NET <br />Can construct tests from scratch via handcoding using the APIs – no specialized classes needed <br />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 <br />Recording in CUIT is intent aware – so, the aggregations are smart enough to guess the intent of users. Eg: LaunchApp<br />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 <br />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 <br />Coded UI tests can also employ multiple UI maps to help segregate code by UI components and allow multiple testers to work on them <br />You can run Coded UI as part of your build<br />You cannot record actions if the application is run under different user credentials<br />You can use Win+I to select controls under the mouse<br />
  9. 9. Coded UI Factoids<br /><ul><li>Coded UI tests are available in Premium and Ultimate
  10. 10. It uses different kinds of accessibility mechanisms for different tech apps – IEDOM for web apps, MSAA for winforms, UIA for WPF
  11. 11. Platforms supported on are available at Gautam’s blog
  12. 12. Supports 2 different langs – C# and VB.NET
  13. 13. Can construct tests from scratch via handcoding using the APIs – no specialized classes needed
  14. 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. 15. Recording in CUIT is intent aware – so, the aggregations are smart enough to guess the intent of users. Eg: LaunchApp
  16. 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. 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. 18. Coded UI tests can also employ multiple UI maps to help segregate code by UI components and allow multiple testers to work on them </li></li></ul><li>Who am I?<br />Robert MacLean<br />http://www.sadev.co.za<br />I may talk a little fast<br />
  19. 19. Overture<br />New in Visual Studio 2010!<br />3 Aspects of Coded UI<br />Coded UIBasics<br />Breaking Coded UI<br />Data Driven Coded UI<br />Please hold questions for the end <br />
  20. 20. I came for the money!<br />Coded UI will save you time<br />
  21. 21. Coded UI<br />
  22. 22. Warning<br />You need Visual Studio Premium or Ultimate for this!<br />
  23. 23. Requirements<br />OS: Win XP SP 3+<br />Arch: x32 or x64<br />Apps: IE 7+, Firefox, WinForms, WPF, Win32, MFC, SharePoint, Ax, Citrix, Terminal Services<br />

×