1 / 194

Automating Coded UI Testing using Microsoft Testing Tools in Visual Studio 2012

Automating Coded UI Testing using Microsoft Testing Tools in Visual Studio 2012. Clive G Hermann. Introductions. Name Title/Function Job Responsibility Testing Experience C# Experience Expectations for the Course. Course Materials. Lab Manual - Printed Course Notes - PowerPoint Slides

radha
Download Presentation

Automating Coded UI Testing using Microsoft Testing Tools in Visual Studio 2012

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Automating Coded UI Testing using Microsoft Testing Tools in Visual Studio 2012 Clive G Hermann

  2. Introductions • Name • Title/Function • Job Responsibility • Testing Experience • C# Experience • Expectations for the Course © GSAtrain

  3. Course Materials • Lab Manual - Printed • Course Notes - PowerPoint Slides • Virtual Machines for TFS and VS 2012 • Links and Whitepapers (Favorites) © GSAtrain

  4. Course Contents • Overview of Automated Code UI Testing • Walkthrough Steps from Beginning-to-End • Creating Manual Tests • Creating a Coded UI Test Using Coded UI Test Builder • Automating Coded UI Test Cases © GSAtrain

  5. Course Contents(Continued) • Data Driven Coded UI Tests • Anatomy of Code UI Tests • Introduction to Lifecycle Management • Extending Coded UI Tests and Action Recordings • Testing Large Applications with Multiple UI Maps © GSAtrain

  6. Course Contents(continued) • Using HTML5 Controls in Coded UI Tests • Visual Studio 2012 ALM Features • Upgrading Coded UI Tests from Visual Studio 2010 • Using WPF with Coded UI Tests • Best Practices for Coded UI Tests © GSAtrain

  7. Course Contents(optional) • Using the Coded UI Test Logs • Using SharePoint with Coded UI Tests • ExcelCodedUIHelper © GSAtrain

  8. Module 1 Overview of Automated Coded UI Testing © GSAtrain

  9. Automated Code UI Testing • UI Testing • Functional Testing • Controls • User Interface • Whole Application • The earlier we catch a “bug” or potential problem the less it costs! • Image • Manpower © GSAtrain

  10. Reality of Automated Testing • 70% of all Testing is manual © GSAtrain

  11. What is Coded UI Testing? • Replacing a Manual User Interface Test with an Automated Test. • To Allow: • Replication • Consistency • Regression Testing For: • Multiple Environments • Multiple Versions © GSAtrain

  12. IT Has a Problem © GSAtrain

  13. Test Early and Often • Catching defects as early as possible is the least expensive way to ensure software quality • Kent Beck and Cynthia Andres wrote • "Here is the dilemma in software development: defects are expensive, but eliminating defects is also expensive.” • “However, most defects end up costing more than it would have cost to prevent them." © GSAtrain

  14. The Testing TrendsForwards • Test-Driven Development • Design the Test • Then Write the Code © GSAtrain

  15. The Testing Trends:Backwards and Circular • Linking it all together • Help-Desk • Test • Story Board • Task • Unit • Programmer © GSAtrain

  16. The Ultimate Goal of Software Testing • To find the bugs before your users do! • UI Testing is END USER TESTING • OR TOTAL SYSTEM TESTING • OR INFRASTRUCTURE TESTING © GSAtrain

  17. Manual to Coded UI © GSAtrain

  18. Testers’ Multiple Roles • Guarantee SOFTWARE QUALITY • Regression Test each Version or Build • Test all Environments • Provide Developers with all the information required: • To REPRODUCE THE “BUG” • Trace the steps to get the BUG • Screen shots, IntelliTrace, Logs and Stack Traces • NO-REPRO must be ELIMINATED © GSAtrain

  19. Tiers of Software Testing • Clear Separation of Functions • Clear Definition of Communication and Collaboration • TEAM of Software Quality © GSAtrain

  20. Module 2 Walkthrough Steps from Beginning-to-End © GSAtrain

  21. Walkthrough Steps from Beginning-to-End • Lesson 1 Manual Testing • Using Microsoft Test Manger to create and manage Test Plans • Running Test Cases and Publishing Results • Conducting Exploratory Testing • Fast Forward for Manual Testing • Lesson 2 Coded User Interface Testing • Automated Functional Tests – Using CUIT • Create a CUIT from Scratch • Create a CUIT from action recording • Making CUIT more Robust and Flexible © GSAtrain

  22. A Manual Testing Process © GSAtrain

  23. Building an AppFor Manual Testing • Demo of Simple Calculator © GSAtrain

  24. Automating the Calculator • Demo © GSAtrain

  25. Adding Data • Demo © GSAtrain

  26. Introducing an Error • Demo © GSAtrain

  27. Hands-On Lab • Walkthrough Steps from Beginning-to-End • Examine the code to be tested • Create a Coded UI • Test the Coded UI • Add a data file to drive the UI Tests • Run all of the tests • Create errors in the data file • Examine failed tests © GSAtrain

  28. Module 3 Creating Manual Tests © GSAtrain

  29. Visual Studio 2012Supported Test Types © GSAtrain

  30. Microsoft Test Manager • Provides a single environment to author and manage Tests © GSAtrain

  31. Testing Center © GSAtrain

  32. Generate Code for Coded UI Test © GSAtrain

  33. Quick Start Guide for Manual Testing using Microsoft Test Manager • http://msdn.microsoft.com/en-us/library/dd380763.aspx © GSAtrain

  34. Easily Reproducing Issues Through Manual Testing • Introducing Managed Exploratory Testing • The 5 Minute “elevator” Video • http://channel9.msdn.com/Series/Visual-Studio-2012-Premium-and-Ultimate-Overview/Visual-Studio-Ultimate-2012-Easily-reproducing-issues-through-manual-testing © GSAtrain

  35. Module 4 Creating a Coded UI Test Using Coded UI Test Builder © GSAtrain

  36. Creating a Coded UI TestUsing Coded UI Test Builder • Test Types • Microsoft Test Manager • Exploratory Testing • Easily reproducing issues through manual testing © GSAtrain

  37. Microsoft Test Manager • The first time you run MTM it will prompt • Add Team Foundation Manager • “If you don’t know the Name, contact your administrator” • It might require “ServerName:Port Number” © GSAtrain

  38. TFS and MTM © GSAtrain

  39. Connecting Microsoft Test Manager to TFS • MTM is always connected to TFS © GSAtrain

  40. Test Plan Properties © GSAtrain

  41. MTM Test Suites • Static suite: the content of this suite is manually added test cases • Query-based suite: a query-based suite lists all test cases matching a given work item filter • Requirements-based suite: this suite shows the test cases associated with a selected TFS requirement © GSAtrain

  42. © GSAtrain

  43. Creating a Lab Environment • With Visual Studio 2012 Lab Management it is possible to create an environment based on existing infrastructure without SCVMM • This is great because we can now start using Lab Management without any additional installation required • The lab machines in a standard environment can be physical or virtual (or both) and the virtual machine does not have to be managed by SCVMM or Hyper-V © GSAtrain

  44. Creating a Lab Environment(continued) • To create a standard environment you only need to know the names of the machine you want to add to the environment and a user account to be used to log in and deploy the test agent service onto the machine • A standard environment can be connected to directly from MTM and the Test Runner making the integration with lab environments really smooth © GSAtrain

  45. Creating a Lab Environment(continued) • The alternative to standard environments is to use a SCVMM environment • The key features of a SCVMM environment include • Create new machines from templates • New lab machines can automatically be created by anyone (having permissions) running MTM • It is no longer required to send a request to the operations department to get machines created for a new environment or to do other maintenance operations such as starting, stopping, snapshotting, or restoring machines © GSAtrain

  46. Creating a Lab Environment(continued) • Support for snapshots • It is possible to work with snapshots from MTM, which enable testers to save state during testing • This is a powerful feature both to unlock the tester if a test case fails (no need to block an environment while waiting for a resolution) but also to give a developer a fixed point in time to reproduce a bug © GSAtrain

  47. Creating a Lab Environment(continued) • Connection inside MTM • A SCVMM environment can be connected to MTM and the Test Runner just like with the standard environment © GSAtrain

  48. KPIs For Software Testing • Number of bugs per state • How many bugs do we have that are active, resolved, or closed? • Are the number of active bugs increasing and number of resolved and closed bugs constant? • Then we need to look into how we perform our testing • Number of bugs sent back from testers for more information • A large number might indicate that communication between developers and testers must improve © GSAtrain

  49. KPIs For Software Testing(continued) • Code coverage • This shows us how much of the code has been covered by our automated unit tests • We get the value as a percentage of the whole code • Tests run results • How are our tests performing? • Do we have many failed tests? • If so, what can we do to improve this? © GSAtrain

  50. KPIs For Software Testing(continued) • Percent Requirements covered by test cases • Do we write test cases for all our requirements? • If not, what is the reason? • Percent Requirements covered by testing • Do we actually run the tests we have test cases for? • If this figure is low and the figure for Percent Requirements covered by test cases is high we might have an issue we need to deal with © GSAtrain

More Related