SlideShare una empresa de Scribd logo
1 de 29
Getting Started with Coded UI Testing:
 Building Your First Automated Test



            Imaginet Resources Corp.
             http://www.imaginet.com
Agenda



• Coded UI Test Overview
• Recording Coded UI
  Tests
• Adding Test Validation
• Writing your own code
• Best Practices
Coded UI Test Tools

• Used to automate testing from the user interface
• Test development/maintenance in Visual Studio
• Tools provided to improve creation and maintenance
  of Coded UI tests
• Can author and maintain tests without writing code or
  can extend tests using .NET
• Can run within Visual Studio or through automation
  (e.g., a build)


         Test development and maintenance from within
                         Visual Studio
Supported Platforms
•   Supported (2012 RTM)           •   Partially Supported
    – Windows Forms 2.0+               –   MFC
    – WPF 3.5+                         –   Dynamix (Ax) 2012 Client
    – SharePoint                       –   Citrix / Terminal Services
    – Internet Explorer 8.0, 9.0       –   PowerBuilder
    – Internet Explorer 10.0
      (Desktop)                    • Unsupported
    – Dynamix CRM web client           –   Internet Explorer < 8.0
                                       –   Silverlight
•   Supported (2012 Update 1)          –   Flash/Java
    – Google Chrome 21+                –   SAP
    – Firefox 15+                      –   Microsoft Office
                                       –   Apple Safari
• Unsupported but may work             –   Opera
    – Windows Win32
Agenda


• Coded UI Test Overview
• Recording Coded UI
  Tests
• Adding Test Validation
• Writing your own code
• Best Practices
Creating Coded UI Tests


 Action Recording
from Manual Tests




  Visual Studio
    Recorder                Coded UI Test




  Visual Studio
    Recorder
Option 1: Based on Existing Tests


     Define        Define        Capture       Automate
      Rqts         Tests          Tests          Tests



• Using Microsoft Test Manager (MTM)…
  – Analyst defines requirements
  – Tester defines manual test cases for the requirement
  – Tester runs test cases and records the steps


• As needed, “Automation Tester” converts recorded
  steps into a Coded UI Test
Option 2: Using the Coded UI Test Builder


• Approach:
  –   Click the record button
  –   Perform the steps in your test target
  –   Click the generate code button
  –   Repeat to generate more methods for the test
  –   Show recorded steps to delete missteps
DEMONSTRATION




• Converting Test Cases

• Using the UI Recorder
Option 3: Author Tests using .NET
• Hand-code in .NET, without any additional assistance 
• Utilize one of the Coded UI-based community frameworks:
   – CUITe (Coded UI Test Enhanced)
      •   Authored by Microsoft employees but not a „product‟
      •   Uses its own tooling to maintain a separate UI object repository
      •   Improves code maintainability
      •   Browser-based only
      •   Currently only supported on Visual Studio 2010
      •   Maintained on CodePlex:
          http://cuite.codeplex.com/

   – Code First Coded UI
      •   Led by Microsoft employees but not a „product‟
      •   Pure code – does not use an object repository
      •   Installable via NuGet
      •   Uses Scaffolding approach to generate tests
      •   Browser-based only
      •   Currently only supported on Visual Studio 2010
      •   Maintained on CodePlex:
          http://codeduicodefirst.codeplex.com/
Agenda



• Coded UI Test
  Overview
• Recording Coded UI
  Tests
• Adding Test Validation
• Writing your own
  code
• Best Practices
Validation
• Use the Coded UI Test Builder
  to add assertions
• Drag the crosshairs to a target
  control
                                        Click to add
• Bundle assertions into                 assertion
  methods called from the test




                                        Select a
                                        property

                                    Generate a method
                                      to record the
                                       assertion(s)
DEMONSTRATION




• Adding Assertions
Agenda




•   Coded UI Test Overview
•   Recording Coded UI Tests
•   Adding Test Validation
•   Writing your own code
•   Best Practices and
    References
The Primary Components
• Test Class (e.g., MyTest.cs)
   – A .NET Coded UI Test class containing one or more Test
     Methods.


• Test Method
   – An individual automated test case inside a Test Class.


• Recorded Method
   – Code which actually automates the UI and performs
     assertions. (Do not change this code!)


• UIMap
   – An XML designer file and related generated classes containing
     the recorded methods.
Overriding Generated Properties

[TestMethod]
public void CodedUITestMethod1()
{
        this.UIMap.OpenCalc();
        this.UIMap.AddThreeAndTwo();
        this.UIMap.VerifySumExpectedValues.UITxtDisplayEditText = "5";
        this.UIMap.VerifySum();
        this.UIMap.CloseCalc();
}


                                      Hand-coded to change the
   “Recorded Methods”                 expected value for the VerifySum
   created using the UI Test          recorded method. There are many
   Builder.                           other overrides made available to
                                      you in the generated code.
The API
Microsoft.VisualStudio.TestingTools.UITesting:
• UITestControl

• Keyboard
   – SendKeys

• Mouse

• Playback.PlaybackSettings…
   –   DelayBetweenActions
   –   MatchExactHierarchy
   –   SearchInMinimizedWindows
   –   SearchTimeout
   –   ThinkTimeMultiplier
   –   WaitForReadyLevel
   –   WaitForReadyTimeout
DEMONSTRATION




• Digging into the Code
Agenda


•   Coded UI Test Overview
•   Recording Coded UI Tests
•   Adding Test Validation
•   Writing your own code
•   Best Practices
Best Practices
• Create each test case as a sequence of Recorded Methods.

• Use multiple UI Maps to separate areas o the application.

• Use meaningful test method names.

• Try to limit the length of each recorded method to less
  than 10 actions.

• Use meaningful UI control names in the application under
  test.

• Do not edit the UIMap.Designer.cs file.

• Use the Coded UI Test Builder and UI Control Locator
  whenever possible.
Summary
•   Coded UI Test Overview

•   Recording Coded UI Tests

•   Adding Test Validation

•   Writing your own code

•   Best Practices
Questions?
Imaginet‟s New Visual Studio 2012 Website!
Visit Imaginet‟s new Visual Studio 2012 website, your one-stop
hub for all your Visual Studio 2012 needs!

         http://visualstudio.imaginet.com
For attendees of today‟s session that fill out the survey

    FREE Imaginet On Demand
   Web Training Subscription Offer
Complete our Post-Webcast survey, and receive 1
free Imaginet On Demand web training
subscription, good for 1 person for 1 month!! The
survey will be emailed to you immediately after this
webcast is over.

What is Imaginet On Demand? Imaginet is proud to announce our newest
web-based training program called Imaginet On Demand, your source for the
best Application Lifecycle Management (ALM) training on the internet.
Imaginet On Demand is a subscription-based training program centric to the
Visual Studio ALM tools, including Visual Studio, Team Foundation Server
(TFS), Microsoft Test Manager, and Microsoft Visual Studio Lab Management.
Learn the new tools of Visual Studio at your pace, from wherever you want.
It's that simple!
Need Help with YOUR Quality Assurance & Testing?

     Imaginet’s Visual Studio 2012
    Testing Tools 10-day Quickstart

• Includes designing, installing, and configuring Microsoft‟s
  testing tools, including Microsoft Test Manager 2012 and
  Automated Testing with Visual Studio 2012.

• Learn best practices for manual and automated testing with
  the Microsoft ALM tools.

• Support and training for your team

• Includes a high-level ALM assessment
Interested? Just email us at info@imaginet.com.
Top Gun Academy Training Classes
• Other Imaginet Training Classes
   – ALM
     •   Microsoft Visual Studio & TFS 2012 – Skills Upgrade (2 days)
     •   Overview Training with Microsoft Visual Studio 2012 ALM Tools (4 days)
     •   Overview Training with Microsoft Visual Studio 2010 ALM Tools (4 days)
     •   Testers Training with Microsoft Visual Studio 2012 ALM Tools (4 days)
     •   Testers Training with Microsoft Visual Studio 2010 ALM Tools (4 days)
     •   Developers Training with Microsoft Visual Studio 2012 ALM Tools (4 days)
     •   Developers Training with Microsoft Visual Studio 2010 ALM Tools (4 days)
     •   Imaginet On Demand Online Web Training

  – Scrum/Kanban
     •   Professional Scrum Foundations (PSF) (2 days)
     •   Professional Scrum Master (PSM) (2 days)
     •   Professional Scrum Developer (PSD) (5 days)
     •   Professional Scrum Master (PSM) Using Microsoft ALM (3 days)
     •   Accredited Core Kanban Using Microsoft ALM (3 days)

                  To register or for more information, please visit our website here:
                    http://www.imaginet.com/ or contact us: info@imaginet.com
ALM Planning & Implementation Services
ALM Planning                                     Testing
•  ALM Assessment & Envisioning Workshops        •  Manual Testing with Test Manager Quick
   (3 or 5 days)                                    Start (5 days)
•  VS & TFS Migration Planning Workshop (5       •  Visual Studio Testing Tools Quick Start (10
   days)                                            days)
•  TFS Deployment Planning* (5 days)             •  Visual Studio Automated Testing Quick Start
•  Visual SourceSafe to TFS Migration               (5 days)
   Planning* (3 Days)                            •  Visual Studio Load Testing Quick Start (5 or
•  Visual Studio Quality Tools Deployment           10 Days)
   Planning* (5 days)
                                                 Builds
Upgrade                                          •  Automated Build & Release Management
•  TFS 2010   Adoption Quick Start (5 or 10         Quick Start (5 days)
   days)                                         •  Automated Build Center of Excellence (CoE)
•  TFS 2012   Adoption Quick Start (5 or 10
   days)
                                                 Database
•  TFS 2010   Upgrade Quick Start (10 days)
                                                 •  Visual Studio Database Tools Quick Start
•  TFS 2012   Upgrade Quick Start (10 days)         (10 days)

Remote Support                                   Integrations
• Remote Support for TFS & Visual Studio         •  Team Foundation Server (TFS) & Project
                                                    Server Integration Quick Start (10 days)
Lab                                              •  TFS & Quality Center Integration/Migration
•  Visual Studio Lab Management Quick Start         Quick Start (10 days)
   (10 days)                      Email us at:
For questions or more information,
       please contact us at:

        info@imaginet.com
          or (972)607-4830
http://www.imaginet.com

Más contenido relacionado

Más de Imaginet

Top Business Benefits of Application Lifecycle Management (ALM)
Top Business Benefits of Application Lifecycle Management (ALM)Top Business Benefits of Application Lifecycle Management (ALM)
Top Business Benefits of Application Lifecycle Management (ALM)Imaginet
 
Upgrading to Team Foundation Server (TFS) 2012 – What You Need to Know! (07-2...
Upgrading to Team Foundation Server (TFS) 2012 – What You Need to Know! (07-2...Upgrading to Team Foundation Server (TFS) 2012 – What You Need to Know! (07-2...
Upgrading to Team Foundation Server (TFS) 2012 – What You Need to Know! (07-2...Imaginet
 
Introduction to Kanban
Introduction to KanbanIntroduction to Kanban
Introduction to KanbanImaginet
 
Getting Started With Coded UI testing: Building Your First Automated Test
Getting Started With Coded UI testing: Building Your First Automated TestGetting Started With Coded UI testing: Building Your First Automated Test
Getting Started With Coded UI testing: Building Your First Automated TestImaginet
 
Managing Test Labs Without the Headaches
Managing Test Labs Without the HeadachesManaging Test Labs Without the Headaches
Managing Test Labs Without the HeadachesImaginet
 
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...Imaginet
 
Managing Test Labs Without the Headaches
Managing Test Labs Without the HeadachesManaging Test Labs Without the Headaches
Managing Test Labs Without the HeadachesImaginet
 
Quality Coding: What's New with Visual Studio 2012
Quality Coding: What's New with Visual Studio 2012Quality Coding: What's New with Visual Studio 2012
Quality Coding: What's New with Visual Studio 2012Imaginet
 
New SharePoint Developer Tools in Visual Studio 2012
New SharePoint Developer Tools in Visual Studio 2012New SharePoint Developer Tools in Visual Studio 2012
New SharePoint Developer Tools in Visual Studio 2012Imaginet
 
Quality Coding: What’s New with Visual Studio 2012
Quality Coding: What’s New with Visual Studio 2012Quality Coding: What’s New with Visual Studio 2012
Quality Coding: What’s New with Visual Studio 2012Imaginet
 
Lean, Kanban and TFS
Lean, Kanban and TFSLean, Kanban and TFS
Lean, Kanban and TFSImaginet
 
The Newest of the New with Visual Studio and TFS 2012
The Newest of the New with Visual Studio and TFS 2012The Newest of the New with Visual Studio and TFS 2012
The Newest of the New with Visual Studio and TFS 2012Imaginet
 
The Newest of the New with Visual Studio and TFS 2012
The Newest of the New with Visual Studio and TFS 2012The Newest of the New with Visual Studio and TFS 2012
The Newest of the New with Visual Studio and TFS 2012Imaginet
 
Using Lean and Kanban to Revolutionize Your Organization
Using Lean and Kanban to Revolutionize Your OrganizationUsing Lean and Kanban to Revolutionize Your Organization
Using Lean and Kanban to Revolutionize Your OrganizationImaginet
 
Lean, Kanban, and TFS
Lean, Kanban, and TFSLean, Kanban, and TFS
Lean, Kanban, and TFSImaginet
 
How Microsoft ALM Tools Can Improve Your Bottom Line
How Microsoft ALM Tools Can Improve Your Bottom LineHow Microsoft ALM Tools Can Improve Your Bottom Line
How Microsoft ALM Tools Can Improve Your Bottom LineImaginet
 
Upgrading to TFS 2012: What You Need to Know!
Upgrading to TFS 2012: What You Need to Know!Upgrading to TFS 2012: What You Need to Know!
Upgrading to TFS 2012: What You Need to Know!Imaginet
 
Getting Started with Coded UI Testing: Building Your First Automated Test
Getting Started with Coded UI Testing: Building Your First Automated TestGetting Started with Coded UI Testing: Building Your First Automated Test
Getting Started with Coded UI Testing: Building Your First Automated TestImaginet
 
Upgrading to Team Foundation Server (TFS) 2012 – What You Need to Know!
Upgrading to Team Foundation Server (TFS) 2012 – What You Need to Know!Upgrading to Team Foundation Server (TFS) 2012 – What You Need to Know!
Upgrading to Team Foundation Server (TFS) 2012 – What You Need to Know!Imaginet
 
Top 10 Business Reasons for ALM
Top 10 Business Reasons for ALMTop 10 Business Reasons for ALM
Top 10 Business Reasons for ALMImaginet
 

Más de Imaginet (20)

Top Business Benefits of Application Lifecycle Management (ALM)
Top Business Benefits of Application Lifecycle Management (ALM)Top Business Benefits of Application Lifecycle Management (ALM)
Top Business Benefits of Application Lifecycle Management (ALM)
 
Upgrading to Team Foundation Server (TFS) 2012 – What You Need to Know! (07-2...
Upgrading to Team Foundation Server (TFS) 2012 – What You Need to Know! (07-2...Upgrading to Team Foundation Server (TFS) 2012 – What You Need to Know! (07-2...
Upgrading to Team Foundation Server (TFS) 2012 – What You Need to Know! (07-2...
 
Introduction to Kanban
Introduction to KanbanIntroduction to Kanban
Introduction to Kanban
 
Getting Started With Coded UI testing: Building Your First Automated Test
Getting Started With Coded UI testing: Building Your First Automated TestGetting Started With Coded UI testing: Building Your First Automated Test
Getting Started With Coded UI testing: Building Your First Automated Test
 
Managing Test Labs Without the Headaches
Managing Test Labs Without the HeadachesManaging Test Labs Without the Headaches
Managing Test Labs Without the Headaches
 
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...
 
Managing Test Labs Without the Headaches
Managing Test Labs Without the HeadachesManaging Test Labs Without the Headaches
Managing Test Labs Without the Headaches
 
Quality Coding: What's New with Visual Studio 2012
Quality Coding: What's New with Visual Studio 2012Quality Coding: What's New with Visual Studio 2012
Quality Coding: What's New with Visual Studio 2012
 
New SharePoint Developer Tools in Visual Studio 2012
New SharePoint Developer Tools in Visual Studio 2012New SharePoint Developer Tools in Visual Studio 2012
New SharePoint Developer Tools in Visual Studio 2012
 
Quality Coding: What’s New with Visual Studio 2012
Quality Coding: What’s New with Visual Studio 2012Quality Coding: What’s New with Visual Studio 2012
Quality Coding: What’s New with Visual Studio 2012
 
Lean, Kanban and TFS
Lean, Kanban and TFSLean, Kanban and TFS
Lean, Kanban and TFS
 
The Newest of the New with Visual Studio and TFS 2012
The Newest of the New with Visual Studio and TFS 2012The Newest of the New with Visual Studio and TFS 2012
The Newest of the New with Visual Studio and TFS 2012
 
The Newest of the New with Visual Studio and TFS 2012
The Newest of the New with Visual Studio and TFS 2012The Newest of the New with Visual Studio and TFS 2012
The Newest of the New with Visual Studio and TFS 2012
 
Using Lean and Kanban to Revolutionize Your Organization
Using Lean and Kanban to Revolutionize Your OrganizationUsing Lean and Kanban to Revolutionize Your Organization
Using Lean and Kanban to Revolutionize Your Organization
 
Lean, Kanban, and TFS
Lean, Kanban, and TFSLean, Kanban, and TFS
Lean, Kanban, and TFS
 
How Microsoft ALM Tools Can Improve Your Bottom Line
How Microsoft ALM Tools Can Improve Your Bottom LineHow Microsoft ALM Tools Can Improve Your Bottom Line
How Microsoft ALM Tools Can Improve Your Bottom Line
 
Upgrading to TFS 2012: What You Need to Know!
Upgrading to TFS 2012: What You Need to Know!Upgrading to TFS 2012: What You Need to Know!
Upgrading to TFS 2012: What You Need to Know!
 
Getting Started with Coded UI Testing: Building Your First Automated Test
Getting Started with Coded UI Testing: Building Your First Automated TestGetting Started with Coded UI Testing: Building Your First Automated Test
Getting Started with Coded UI Testing: Building Your First Automated Test
 
Upgrading to Team Foundation Server (TFS) 2012 – What You Need to Know!
Upgrading to Team Foundation Server (TFS) 2012 – What You Need to Know!Upgrading to Team Foundation Server (TFS) 2012 – What You Need to Know!
Upgrading to Team Foundation Server (TFS) 2012 – What You Need to Know!
 
Top 10 Business Reasons for ALM
Top 10 Business Reasons for ALMTop 10 Business Reasons for ALM
Top 10 Business Reasons for ALM
 

Último

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Último (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Getting Started with Visual Studio’s Coded UI Testing: Building Your First Automated Test

  • 1. Getting Started with Coded UI Testing: Building Your First Automated Test Imaginet Resources Corp. http://www.imaginet.com
  • 2. Agenda • Coded UI Test Overview • Recording Coded UI Tests • Adding Test Validation • Writing your own code • Best Practices
  • 3. Coded UI Test Tools • Used to automate testing from the user interface • Test development/maintenance in Visual Studio • Tools provided to improve creation and maintenance of Coded UI tests • Can author and maintain tests without writing code or can extend tests using .NET • Can run within Visual Studio or through automation (e.g., a build) Test development and maintenance from within Visual Studio
  • 4. Supported Platforms • Supported (2012 RTM) • Partially Supported – Windows Forms 2.0+ – MFC – WPF 3.5+ – Dynamix (Ax) 2012 Client – SharePoint – Citrix / Terminal Services – Internet Explorer 8.0, 9.0 – PowerBuilder – Internet Explorer 10.0 (Desktop) • Unsupported – Dynamix CRM web client – Internet Explorer < 8.0 – Silverlight • Supported (2012 Update 1) – Flash/Java – Google Chrome 21+ – SAP – Firefox 15+ – Microsoft Office – Apple Safari • Unsupported but may work – Opera – Windows Win32
  • 5. Agenda • Coded UI Test Overview • Recording Coded UI Tests • Adding Test Validation • Writing your own code • Best Practices
  • 6. Creating Coded UI Tests Action Recording from Manual Tests Visual Studio Recorder Coded UI Test Visual Studio Recorder
  • 7. Option 1: Based on Existing Tests Define Define Capture Automate Rqts Tests Tests Tests • Using Microsoft Test Manager (MTM)… – Analyst defines requirements – Tester defines manual test cases for the requirement – Tester runs test cases and records the steps • As needed, “Automation Tester” converts recorded steps into a Coded UI Test
  • 8. Option 2: Using the Coded UI Test Builder • Approach: – Click the record button – Perform the steps in your test target – Click the generate code button – Repeat to generate more methods for the test – Show recorded steps to delete missteps
  • 9. DEMONSTRATION • Converting Test Cases • Using the UI Recorder
  • 10. Option 3: Author Tests using .NET • Hand-code in .NET, without any additional assistance  • Utilize one of the Coded UI-based community frameworks: – CUITe (Coded UI Test Enhanced) • Authored by Microsoft employees but not a „product‟ • Uses its own tooling to maintain a separate UI object repository • Improves code maintainability • Browser-based only • Currently only supported on Visual Studio 2010 • Maintained on CodePlex: http://cuite.codeplex.com/ – Code First Coded UI • Led by Microsoft employees but not a „product‟ • Pure code – does not use an object repository • Installable via NuGet • Uses Scaffolding approach to generate tests • Browser-based only • Currently only supported on Visual Studio 2010 • Maintained on CodePlex: http://codeduicodefirst.codeplex.com/
  • 11. Agenda • Coded UI Test Overview • Recording Coded UI Tests • Adding Test Validation • Writing your own code • Best Practices
  • 12. Validation • Use the Coded UI Test Builder to add assertions • Drag the crosshairs to a target control Click to add • Bundle assertions into assertion methods called from the test Select a property Generate a method to record the assertion(s)
  • 14. Agenda • Coded UI Test Overview • Recording Coded UI Tests • Adding Test Validation • Writing your own code • Best Practices and References
  • 15. The Primary Components • Test Class (e.g., MyTest.cs) – A .NET Coded UI Test class containing one or more Test Methods. • Test Method – An individual automated test case inside a Test Class. • Recorded Method – Code which actually automates the UI and performs assertions. (Do not change this code!) • UIMap – An XML designer file and related generated classes containing the recorded methods.
  • 16. Overriding Generated Properties [TestMethod] public void CodedUITestMethod1() { this.UIMap.OpenCalc(); this.UIMap.AddThreeAndTwo(); this.UIMap.VerifySumExpectedValues.UITxtDisplayEditText = "5"; this.UIMap.VerifySum(); this.UIMap.CloseCalc(); } Hand-coded to change the “Recorded Methods” expected value for the VerifySum created using the UI Test recorded method. There are many Builder. other overrides made available to you in the generated code.
  • 17. The API Microsoft.VisualStudio.TestingTools.UITesting: • UITestControl • Keyboard – SendKeys • Mouse • Playback.PlaybackSettings… – DelayBetweenActions – MatchExactHierarchy – SearchInMinimizedWindows – SearchTimeout – ThinkTimeMultiplier – WaitForReadyLevel – WaitForReadyTimeout
  • 19. Agenda • Coded UI Test Overview • Recording Coded UI Tests • Adding Test Validation • Writing your own code • Best Practices
  • 20. Best Practices • Create each test case as a sequence of Recorded Methods. • Use multiple UI Maps to separate areas o the application. • Use meaningful test method names. • Try to limit the length of each recorded method to less than 10 actions. • Use meaningful UI control names in the application under test. • Do not edit the UIMap.Designer.cs file. • Use the Coded UI Test Builder and UI Control Locator whenever possible.
  • 21. Summary • Coded UI Test Overview • Recording Coded UI Tests • Adding Test Validation • Writing your own code • Best Practices
  • 23. Imaginet‟s New Visual Studio 2012 Website! Visit Imaginet‟s new Visual Studio 2012 website, your one-stop hub for all your Visual Studio 2012 needs! http://visualstudio.imaginet.com
  • 24. For attendees of today‟s session that fill out the survey FREE Imaginet On Demand Web Training Subscription Offer Complete our Post-Webcast survey, and receive 1 free Imaginet On Demand web training subscription, good for 1 person for 1 month!! The survey will be emailed to you immediately after this webcast is over. What is Imaginet On Demand? Imaginet is proud to announce our newest web-based training program called Imaginet On Demand, your source for the best Application Lifecycle Management (ALM) training on the internet. Imaginet On Demand is a subscription-based training program centric to the Visual Studio ALM tools, including Visual Studio, Team Foundation Server (TFS), Microsoft Test Manager, and Microsoft Visual Studio Lab Management. Learn the new tools of Visual Studio at your pace, from wherever you want. It's that simple!
  • 25. Need Help with YOUR Quality Assurance & Testing? Imaginet’s Visual Studio 2012 Testing Tools 10-day Quickstart • Includes designing, installing, and configuring Microsoft‟s testing tools, including Microsoft Test Manager 2012 and Automated Testing with Visual Studio 2012. • Learn best practices for manual and automated testing with the Microsoft ALM tools. • Support and training for your team • Includes a high-level ALM assessment Interested? Just email us at info@imaginet.com.
  • 26. Top Gun Academy Training Classes • Other Imaginet Training Classes – ALM • Microsoft Visual Studio & TFS 2012 – Skills Upgrade (2 days) • Overview Training with Microsoft Visual Studio 2012 ALM Tools (4 days) • Overview Training with Microsoft Visual Studio 2010 ALM Tools (4 days) • Testers Training with Microsoft Visual Studio 2012 ALM Tools (4 days) • Testers Training with Microsoft Visual Studio 2010 ALM Tools (4 days) • Developers Training with Microsoft Visual Studio 2012 ALM Tools (4 days) • Developers Training with Microsoft Visual Studio 2010 ALM Tools (4 days) • Imaginet On Demand Online Web Training – Scrum/Kanban • Professional Scrum Foundations (PSF) (2 days) • Professional Scrum Master (PSM) (2 days) • Professional Scrum Developer (PSD) (5 days) • Professional Scrum Master (PSM) Using Microsoft ALM (3 days) • Accredited Core Kanban Using Microsoft ALM (3 days) To register or for more information, please visit our website here: http://www.imaginet.com/ or contact us: info@imaginet.com
  • 27. ALM Planning & Implementation Services ALM Planning Testing • ALM Assessment & Envisioning Workshops • Manual Testing with Test Manager Quick (3 or 5 days) Start (5 days) • VS & TFS Migration Planning Workshop (5 • Visual Studio Testing Tools Quick Start (10 days) days) • TFS Deployment Planning* (5 days) • Visual Studio Automated Testing Quick Start • Visual SourceSafe to TFS Migration (5 days) Planning* (3 Days) • Visual Studio Load Testing Quick Start (5 or • Visual Studio Quality Tools Deployment 10 Days) Planning* (5 days) Builds Upgrade • Automated Build & Release Management • TFS 2010 Adoption Quick Start (5 or 10 Quick Start (5 days) days) • Automated Build Center of Excellence (CoE) • TFS 2012 Adoption Quick Start (5 or 10 days) Database • TFS 2010 Upgrade Quick Start (10 days) • Visual Studio Database Tools Quick Start • TFS 2012 Upgrade Quick Start (10 days) (10 days) Remote Support Integrations • Remote Support for TFS & Visual Studio • Team Foundation Server (TFS) & Project Server Integration Quick Start (10 days) Lab • TFS & Quality Center Integration/Migration • Visual Studio Lab Management Quick Start Quick Start (10 days) (10 days) Email us at:
  • 28. For questions or more information, please contact us at: info@imaginet.com or (972)607-4830

Notas del editor

  1. This training seminar will demonstrate how to record tests run against various types of application user interfaces using Microsoft Visual Studio&apos;s Coded UI Tests and how to replay them at any time. Additionally, we will explore how to embed validations, either simple or elaborate, to ensure your application is producing the correct results. Learn how to improve the quality of your applications by having a repeatable set of Microsoft Coded UI Tests available to ensure defects don’t go unnoticed!
  2. Extensible framework. Sample shows testing support for MS ExcelUpdated, source: http://msdn.microsoft.com/en-us/library/dd380742.aspxFirefox dropped: http://msdn.microsoft.com/en-us/library/hh506981.aspx---
  3. Source: http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.uitesting.aspx
  4. Source: http://msdn.microsoft.com/en-us/library/dd380782.aspx
  5. Want to know more?