SlideShare a Scribd company logo
Automatic Testing using the Coded UI Framework
Lesson 4 – Coded UI Test
Omer Karpas
Creating a Coded UI test
 To create a Coded UI Test (several options):
 From the Top Menu: Test -> New Test
Creating a Coded UI test
 select “Coded UI Test”, enter a name for the test and
press OK.
Creating a Coded UI test
 To create a Coded UI Test (several options):
 From the Solution Explorer: right click on a folder or on
the project file -> Add -> Coded UI Test…
Anatomy of a Coded UI Test
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Windows.Input;
using System.Windows.Forms;
using System.Drawing;
using
Microsoft.VisualStudio.TestTools.UIT
esting;
using
Microsoft.VisualStudio.TestTools.Uni
tTesting;
using
Microsoft.VisualStudio.TestTools.UIT
est.Extension;
using Keyboard =
Microsoft.VisualStudio.TestTools.UIT
esting.Keyboard;
 In this section we add all
classes we need to create
coded ui tests.
 The last 4 classes are from
Microsoft Testing
Framework.
 We need the “UnitTesting”
class, although we do not
create unit tests, because it
contains basic parts like the
Test Execution engine.
Anatomy of a Coded UI Test
namespace TestProject1
{
/// <summary>
/// Summary description for
CodedUITest1
/// </summary>
[CodedUITest]
public class CodedUITest1
{
public CodedUITest1()
{
}
 The namespace where this
test belongs to. By default it’s
the name of the Project but
can be changed.
 CodedUITest Attribute
allows the testing
framework to recognize it
as a testing extension.
 The class name
 The class default Constractor
Anatomy of a Coded UI Test
[TestMethod]
public void CodedUITestMethod1()
}
// To generate code for this
test, select "Generate Code for
Coded UI Test" from the shortcut
menu and select one of the menu
items.
// For more information on
generated code, see
http://go.microsoft.com/fwlink/?
LinkId=179463
{
 The TestMethodAttribute is
automatically applied to the
method, which allows the testing
framework to recognize it as a Test
Method to show in the Test View.
 This method contains calls to
methods of Actions and
Verifications located in other files
(the UIMap or the Implementaion
file).
Anatomy of a Coded UI Test
#region Additional test attributes
// You can use the following additional
attributes as you write your tests:
////Use TestInitialize to run code before
running each test
//[TestInitialize()]
//public void MyTestInitialize()
//}
// To generate code for this test, select
"Generate Code for Coded UI Test" from
the shortcut menu and select one of the
menu items.
// For more information on generated code,
see
http://go.microsoft.com/fwlink/?LinkId=
179463
//{
 TestInitialize attribute
causes this method to run
before the TestMethod
method.
 This method is used for
Prerequisites of the test.
Example: create data to be
used in the test.
 Use of this method is
optional.
Anatomy of a Coded UI Test
////Use TestCleanup to run code
after each test has run
//[TestCleanup()]
//public void MyTestCleanup()
//}
// To generate code for this test,
select "Generate Code for Coded UI
Test" from the shortcut menu and
select one of the menu items.
// For more information on generated
code, see
http://go.microsoft.com/fwlink/?Li
nkId=179463
//{
#endregion
 TestCleanup attribute
causes this method to run
after the TestMethod
method.
 This method is used for
Post requisites of the test.
Example: delete data that
was created by the test.
 Use of this method is
optional.
Anatomy of a Coded UI Test
/// <summary>
///Gets or sets the test context which
provides
///information about and functionality for
the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
{
private TestContext testContextInstance;
 TestContext property.
 This class is used to store data
related to the tests.
 Examples:
 test name.
 Test state (fail/pass).
 Etc..
Anatomy of a Coded UI Test
public UIMap UIMap
}
get
}
if ((this.map == null))
}
this.map = new UIMap();
{
return this.map;
{
{
private UIMap map;
 UIMap property.
 Create an instance of the
UIMap.
Ad

Recommended

Coded UI: Hand Coding based on Page Object Model
Coded UI: Hand Coding based on Page Object Model
Tharinda Liyanage
 
Coded ui - lesson 6 - manual coding
Coded ui - lesson 6 - manual coding
Omer Karpas
 
Coded UI - Test automation Practices from the Field
Coded UI - Test automation Practices from the Field
Clemens Reijnen
 
Coded ui - lesson 2 - coded ui test builder
Coded ui - lesson 2 - coded ui test builder
Omer Karpas
 
Coded ui - lesson 1 - overview
Coded ui - lesson 1 - overview
Omer Karpas
 
Advanced Coded UI Testing
Advanced Coded UI Testing
Shai Raiten
 
Coded ui - lesson 9 - test windows
Coded ui - lesson 9 - test windows
Omer Karpas
 
Coded ui test
Coded ui test
Abhimanyu Singhal
 
Coded ui in a nutshell
Coded ui in a nutshell
Omer Karpas
 
Coded ui - lesson 3 - case study - calculator
Coded ui - lesson 3 - case study - calculator
Omer Karpas
 
UI testing frameworks and the Coded UI testing paradigm
UI testing frameworks and the Coded UI testing paradigm
Arnold Stellio
 
Testing the User Interface - Coded UI Tests with Visual Studio 2010
Testing the User Interface - Coded UI Tests with Visual Studio 2010
Eric D. Boyd
 
Unit testing with visual studio 2012
Unit testing with visual studio 2012
Abhimanyu Singhal
 
Deep Dive Modern Apps Lifecycle with Visual Studio 2012: How to create cross ...
Deep Dive Modern Apps Lifecycle with Visual Studio 2012: How to create cross ...
Microsoft Developer Network (MSDN) - Belgium and Luxembourg
 
Remote Test Execution using TFS 2015 (RC2 and beyond)
Remote Test Execution using TFS 2015 (RC2 and beyond)
Allen Mathias
 
Coded ui - lesson 5 - ui map
Coded ui - lesson 5 - ui map
Omer Karpas
 
Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010
Clemens Reijnen
 
Active x
Active x
andrew20827
 
MTM Test Management System
MTM Test Management System
Minu Mishra
 
Automation Testing with TestComplete
Automation Testing with TestComplete
RomSoft SRL
 
Testing tools in visual studio
Testing tools in visual studio
Mahdi Esmailoghli
 
Getting started with test complete 7
Getting started with test complete 7
Hoamuoigio Hoa
 
QA with Microsoft Test Manager and Lab Management
QA with Microsoft Test Manager and Lab Management
Rofiqi Setiawan
 
Intro to Microsoft Test Manager
Intro to Microsoft Test Manager
Esteban Garcia
 
Continuous Integration for iOS
Continuous Integration for iOS
CODETE
 
Visual Basic IDE Introduction
Visual Basic IDE Introduction
Ahllen Javier
 
Lab Management with TFS 2010
Lab Management with TFS 2010
Ed Blankenship
 
Visual studio Team system 2012
Visual studio Team system 2012
kunnathust
 
Getting Started With Coded UI testing: Building Your First Automated Test
Getting Started With Coded UI testing: Building Your First Automated Test
Imaginet
 
Microsoft Testing Tour - Functional and Automated Testing
Microsoft Testing Tour - Functional and Automated Testing
Angela Dugan
 

More Related Content

What's hot (20)

Coded ui in a nutshell
Coded ui in a nutshell
Omer Karpas
 
Coded ui - lesson 3 - case study - calculator
Coded ui - lesson 3 - case study - calculator
Omer Karpas
 
UI testing frameworks and the Coded UI testing paradigm
UI testing frameworks and the Coded UI testing paradigm
Arnold Stellio
 
Testing the User Interface - Coded UI Tests with Visual Studio 2010
Testing the User Interface - Coded UI Tests with Visual Studio 2010
Eric D. Boyd
 
Unit testing with visual studio 2012
Unit testing with visual studio 2012
Abhimanyu Singhal
 
Deep Dive Modern Apps Lifecycle with Visual Studio 2012: How to create cross ...
Deep Dive Modern Apps Lifecycle with Visual Studio 2012: How to create cross ...
Microsoft Developer Network (MSDN) - Belgium and Luxembourg
 
Remote Test Execution using TFS 2015 (RC2 and beyond)
Remote Test Execution using TFS 2015 (RC2 and beyond)
Allen Mathias
 
Coded ui - lesson 5 - ui map
Coded ui - lesson 5 - ui map
Omer Karpas
 
Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010
Clemens Reijnen
 
Active x
Active x
andrew20827
 
MTM Test Management System
MTM Test Management System
Minu Mishra
 
Automation Testing with TestComplete
Automation Testing with TestComplete
RomSoft SRL
 
Testing tools in visual studio
Testing tools in visual studio
Mahdi Esmailoghli
 
Getting started with test complete 7
Getting started with test complete 7
Hoamuoigio Hoa
 
QA with Microsoft Test Manager and Lab Management
QA with Microsoft Test Manager and Lab Management
Rofiqi Setiawan
 
Intro to Microsoft Test Manager
Intro to Microsoft Test Manager
Esteban Garcia
 
Continuous Integration for iOS
Continuous Integration for iOS
CODETE
 
Visual Basic IDE Introduction
Visual Basic IDE Introduction
Ahllen Javier
 
Lab Management with TFS 2010
Lab Management with TFS 2010
Ed Blankenship
 
Visual studio Team system 2012
Visual studio Team system 2012
kunnathust
 
Coded ui in a nutshell
Coded ui in a nutshell
Omer Karpas
 
Coded ui - lesson 3 - case study - calculator
Coded ui - lesson 3 - case study - calculator
Omer Karpas
 
UI testing frameworks and the Coded UI testing paradigm
UI testing frameworks and the Coded UI testing paradigm
Arnold Stellio
 
Testing the User Interface - Coded UI Tests with Visual Studio 2010
Testing the User Interface - Coded UI Tests with Visual Studio 2010
Eric D. Boyd
 
Unit testing with visual studio 2012
Unit testing with visual studio 2012
Abhimanyu Singhal
 
Remote Test Execution using TFS 2015 (RC2 and beyond)
Remote Test Execution using TFS 2015 (RC2 and beyond)
Allen Mathias
 
Coded ui - lesson 5 - ui map
Coded ui - lesson 5 - ui map
Omer Karpas
 
Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010
Clemens Reijnen
 
MTM Test Management System
MTM Test Management System
Minu Mishra
 
Automation Testing with TestComplete
Automation Testing with TestComplete
RomSoft SRL
 
Testing tools in visual studio
Testing tools in visual studio
Mahdi Esmailoghli
 
Getting started with test complete 7
Getting started with test complete 7
Hoamuoigio Hoa
 
QA with Microsoft Test Manager and Lab Management
QA with Microsoft Test Manager and Lab Management
Rofiqi Setiawan
 
Intro to Microsoft Test Manager
Intro to Microsoft Test Manager
Esteban Garcia
 
Continuous Integration for iOS
Continuous Integration for iOS
CODETE
 
Visual Basic IDE Introduction
Visual Basic IDE Introduction
Ahllen Javier
 
Lab Management with TFS 2010
Lab Management with TFS 2010
Ed Blankenship
 
Visual studio Team system 2012
Visual studio Team system 2012
kunnathust
 

Similar to Coded ui - lesson 4 - coded ui test (20)

Getting Started With Coded UI testing: Building Your First Automated Test
Getting Started With Coded UI testing: Building Your First Automated Test
Imaginet
 
Microsoft Testing Tour - Functional and Automated Testing
Microsoft Testing Tour - Functional and Automated Testing
Angela Dugan
 
Getting Started with Coded UI Testing: Building Your First Automated Test
Getting Started with Coded UI Testing: Building Your First Automated Test
Imaginet
 
Practical alm testing
Practical alm testing
Igor Moochnick
 
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
 
Udvid din test portefølje med coded ui test og cloud load test
Udvid din test portefølje med coded ui test og cloud load test
Peter Lindberg
 
MTLM Visual Studio 2010 ALM - day2
MTLM Visual Studio 2010 ALM - day2
Clemens Reijnen
 
Testar2014 presentation
Testar2014 presentation
Tanja Vos
 
.Net Unit Testing with Visual Studio 2010
.Net Unit Testing with Visual Studio 2010
kgayda
 
UI Tests Are Fun To Write (If You Write Them Right)
UI Tests Are Fun To Write (If You Write Them Right)
Seth Petry-Johnson
 
Alexandre Iline Rit 2010 Java Fxui
Alexandre Iline Rit 2010 Java Fxui
rit2010
 
Alexandre.iline rit 2010 java_fxui_extra
Alexandre.iline rit 2010 java_fxui_extra
rit2010
 
Test Design: Scaling UI Automation from the Ground Up
Test Design: Scaling UI Automation from the Ground Up
SmartBear
 
Unit Testing Using N Unit
Unit Testing Using N Unit
Gaurav Arora
 
03 test specification and execution
03 test specification and execution
Clemens Reijnen
 
Writing Tests with the Unity Test Framework
Writing Tests with the Unity Test Framework
Peter Kofler
 
UI Testing with Spec
UI Testing with Spec
Pharo
 
Xam expertday
Xam expertday
Codrina Merigo
 
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Jacinto Limjap
 
HDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing Tools
HDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing Tools
Jeff Bramwell
 
Getting Started With Coded UI testing: Building Your First Automated Test
Getting Started With Coded UI testing: Building Your First Automated Test
Imaginet
 
Microsoft Testing Tour - Functional and Automated Testing
Microsoft Testing Tour - Functional and Automated Testing
Angela Dugan
 
Getting Started with Coded UI Testing: Building Your First Automated Test
Getting Started with Coded UI Testing: Building Your First Automated Test
Imaginet
 
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
 
Udvid din test portefølje med coded ui test og cloud load test
Udvid din test portefølje med coded ui test og cloud load test
Peter Lindberg
 
MTLM Visual Studio 2010 ALM - day2
MTLM Visual Studio 2010 ALM - day2
Clemens Reijnen
 
Testar2014 presentation
Testar2014 presentation
Tanja Vos
 
.Net Unit Testing with Visual Studio 2010
.Net Unit Testing with Visual Studio 2010
kgayda
 
UI Tests Are Fun To Write (If You Write Them Right)
UI Tests Are Fun To Write (If You Write Them Right)
Seth Petry-Johnson
 
Alexandre Iline Rit 2010 Java Fxui
Alexandre Iline Rit 2010 Java Fxui
rit2010
 
Alexandre.iline rit 2010 java_fxui_extra
Alexandre.iline rit 2010 java_fxui_extra
rit2010
 
Test Design: Scaling UI Automation from the Ground Up
Test Design: Scaling UI Automation from the Ground Up
SmartBear
 
Unit Testing Using N Unit
Unit Testing Using N Unit
Gaurav Arora
 
03 test specification and execution
03 test specification and execution
Clemens Reijnen
 
Writing Tests with the Unity Test Framework
Writing Tests with the Unity Test Framework
Peter Kofler
 
UI Testing with Spec
UI Testing with Spec
Pharo
 
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Jacinto Limjap
 
HDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing Tools
HDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing Tools
Jeff Bramwell
 
Ad

Recently uploaded (20)

Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
AI for PV: Development and Governance for a Regulated Industry
AI for PV: Development and Governance for a Regulated Industry
Biologit
 
HYBRIDIZATION OF ALKANES AND ALKENES ...
HYBRIDIZATION OF ALKANES AND ALKENES ...
karishmaduhijod1
 
NEW-IDM Crack with Internet Download Manager 6.42 Build 27 VERSION
NEW-IDM Crack with Internet Download Manager 6.42 Build 27 VERSION
grete1122g
 
From Data Preparation to Inference: How Alluxio Speeds Up AI
From Data Preparation to Inference: How Alluxio Speeds Up AI
Alluxio, Inc.
 
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
Hassan Abid
 
declaration of Variables and constants.pptx
declaration of Variables and constants.pptx
meemee7378
 
How Automation in Claims Handling Streamlined Operations
How Automation in Claims Handling Streamlined Operations
Insurance Tech Services
 
From Code to Commerce, a Backend Java Developer's Galactic Journey into Ecomm...
From Code to Commerce, a Backend Java Developer's Galactic Journey into Ecomm...
Jamie Coleman
 
Key Challenges in Troubleshooting Customer On-Premise Applications
Key Challenges in Troubleshooting Customer On-Premise Applications
Tier1 app
 
Complete WordPress Programming Guidance Book
Complete WordPress Programming Guidance Book
Shabista Imam
 
Why Edge Computing Matters in Mobile Application Tech.pdf
Why Edge Computing Matters in Mobile Application Tech.pdf
IMG Global Infotech
 
Simplify Insurance Regulations with Compliance Management Software
Simplify Insurance Regulations with Compliance Management Software
Insurance Tech Services
 
Best Practice for LLM Serving in the Cloud
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
 
Azure AI Foundry: The AI app and agent factory
Azure AI Foundry: The AI app and agent factory
Maxim Salnikov
 
arctitecture application system design os dsa
arctitecture application system design os dsa
za241967
 
Which Hiring Management Tools Offer the Best ROI?
Which Hiring Management Tools Offer the Best ROI?
HireME
 
Y - Recursion The Hard Way GopherCon EU 2025
Y - Recursion The Hard Way GopherCon EU 2025
Eleanor McHugh
 
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Muhammad Fahad Bashir
 
Humans vs AI Call Agents - Qcall.ai's Special Report
Humans vs AI Call Agents - Qcall.ai's Special Report
Udit Goenka
 
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
AI for PV: Development and Governance for a Regulated Industry
AI for PV: Development and Governance for a Regulated Industry
Biologit
 
HYBRIDIZATION OF ALKANES AND ALKENES ...
HYBRIDIZATION OF ALKANES AND ALKENES ...
karishmaduhijod1
 
NEW-IDM Crack with Internet Download Manager 6.42 Build 27 VERSION
NEW-IDM Crack with Internet Download Manager 6.42 Build 27 VERSION
grete1122g
 
From Data Preparation to Inference: How Alluxio Speeds Up AI
From Data Preparation to Inference: How Alluxio Speeds Up AI
Alluxio, Inc.
 
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
Hassan Abid
 
declaration of Variables and constants.pptx
declaration of Variables and constants.pptx
meemee7378
 
How Automation in Claims Handling Streamlined Operations
How Automation in Claims Handling Streamlined Operations
Insurance Tech Services
 
From Code to Commerce, a Backend Java Developer's Galactic Journey into Ecomm...
From Code to Commerce, a Backend Java Developer's Galactic Journey into Ecomm...
Jamie Coleman
 
Key Challenges in Troubleshooting Customer On-Premise Applications
Key Challenges in Troubleshooting Customer On-Premise Applications
Tier1 app
 
Complete WordPress Programming Guidance Book
Complete WordPress Programming Guidance Book
Shabista Imam
 
Why Edge Computing Matters in Mobile Application Tech.pdf
Why Edge Computing Matters in Mobile Application Tech.pdf
IMG Global Infotech
 
Simplify Insurance Regulations with Compliance Management Software
Simplify Insurance Regulations with Compliance Management Software
Insurance Tech Services
 
Best Practice for LLM Serving in the Cloud
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
 
Azure AI Foundry: The AI app and agent factory
Azure AI Foundry: The AI app and agent factory
Maxim Salnikov
 
arctitecture application system design os dsa
arctitecture application system design os dsa
za241967
 
Which Hiring Management Tools Offer the Best ROI?
Which Hiring Management Tools Offer the Best ROI?
HireME
 
Y - Recursion The Hard Way GopherCon EU 2025
Y - Recursion The Hard Way GopherCon EU 2025
Eleanor McHugh
 
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Muhammad Fahad Bashir
 
Humans vs AI Call Agents - Qcall.ai's Special Report
Humans vs AI Call Agents - Qcall.ai's Special Report
Udit Goenka
 
Ad

Coded ui - lesson 4 - coded ui test

  • 1. Automatic Testing using the Coded UI Framework Lesson 4 – Coded UI Test Omer Karpas
  • 2. Creating a Coded UI test  To create a Coded UI Test (several options):  From the Top Menu: Test -> New Test
  • 3. Creating a Coded UI test  select “Coded UI Test”, enter a name for the test and press OK.
  • 4. Creating a Coded UI test  To create a Coded UI Test (several options):  From the Solution Explorer: right click on a folder or on the project file -> Add -> Coded UI Test…
  • 5. Anatomy of a Coded UI Test using System; using System.Collections.Generic; using System.Text.RegularExpressions; using System.Windows.Input; using System.Windows.Forms; using System.Drawing; using Microsoft.VisualStudio.TestTools.UIT esting; using Microsoft.VisualStudio.TestTools.Uni tTesting; using Microsoft.VisualStudio.TestTools.UIT est.Extension; using Keyboard = Microsoft.VisualStudio.TestTools.UIT esting.Keyboard;  In this section we add all classes we need to create coded ui tests.  The last 4 classes are from Microsoft Testing Framework.  We need the “UnitTesting” class, although we do not create unit tests, because it contains basic parts like the Test Execution engine.
  • 6. Anatomy of a Coded UI Test namespace TestProject1 { /// <summary> /// Summary description for CodedUITest1 /// </summary> [CodedUITest] public class CodedUITest1 { public CodedUITest1() { }  The namespace where this test belongs to. By default it’s the name of the Project but can be changed.  CodedUITest Attribute allows the testing framework to recognize it as a testing extension.  The class name  The class default Constractor
  • 7. Anatomy of a Coded UI Test [TestMethod] public void CodedUITestMethod1() } // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. // For more information on generated code, see http://go.microsoft.com/fwlink/? LinkId=179463 {  The TestMethodAttribute is automatically applied to the method, which allows the testing framework to recognize it as a Test Method to show in the Test View.  This method contains calls to methods of Actions and Verifications located in other files (the UIMap or the Implementaion file).
  • 8. Anatomy of a Coded UI Test #region Additional test attributes // You can use the following additional attributes as you write your tests: ////Use TestInitialize to run code before running each test //[TestInitialize()] //public void MyTestInitialize() //} // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId= 179463 //{  TestInitialize attribute causes this method to run before the TestMethod method.  This method is used for Prerequisites of the test. Example: create data to be used in the test.  Use of this method is optional.
  • 9. Anatomy of a Coded UI Test ////Use TestCleanup to run code after each test has run //[TestCleanup()] //public void MyTestCleanup() //} // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. // For more information on generated code, see http://go.microsoft.com/fwlink/?Li nkId=179463 //{ #endregion  TestCleanup attribute causes this method to run after the TestMethod method.  This method is used for Post requisites of the test. Example: delete data that was created by the test.  Use of this method is optional.
  • 10. Anatomy of a Coded UI Test /// <summary> ///Gets or sets the test context which provides ///information about and functionality for the current test run. ///</summary> public TestContext TestContext { get { return testContextInstance; } set { testContextInstance = value; } { private TestContext testContextInstance;  TestContext property.  This class is used to store data related to the tests.  Examples:  test name.  Test state (fail/pass).  Etc..
  • 11. Anatomy of a Coded UI Test public UIMap UIMap } get } if ((this.map == null)) } this.map = new UIMap(); { return this.map; { { private UIMap map;  UIMap property.  Create an instance of the UIMap.