SlideShare a Scribd company logo
Coded UI
in a nutshell
Omer Karpas
Abbreviations and Professional Terms
(Glossary)
Abbreviation or term Definition
KDT Keywords Driven Testing
AUT Application Under Test
VS Visual Studio
BB Building Block
GUI Graphical User Interface
VB Visual Basic
CUIT Coded UI Test
TC Test Case
Scenario Synonym for Test Case
Keyword Driven Testing
 In KDT (keyword-driven testing), each keyword
corresponds to an individual testing Action or Verification.
 Examples:
 A mouse click
 Selection of a menu item
 Keystrokes
 Opening or closing a window
 Verifying a control is visible
 Verifying a control is enabled
 Etc…
Keyword Driven Testing
 A keyword-driven test is a sequence of keywords, that
simulate user actions on the AUT (Application Under Test).
 Basically, to create a test, testers simply order the
corresponding keywords of the desired Actions and
Verifications.
 Keywords are commonly called Modules or BB
(Building Blocks).
Keyword Driven Testing
 Pros:
 Reuse of code
 Allows non-coding personals to build scenarios from the
BB.
 Much easier maintenance
 Cons:
 Takes more coding time
 Conclusion – KDT is the way to go!
Microsoft Coded UI
Framework
 “You can use Visual Studio 2010 Ultimate or Visual
Studio 2010 Premium to create automated tests of the
user interface (UI) known as coded UI tests. These tests
provide functional testing of the user interface and
validation of user interface controls. Automated UI
tests enable you to test that the user interface is
functioning correctly after code changes. They are
quicker to run than manual tests. Therefore, you can
run them more frequently.“ (MSDN)
Microsoft Coded UI
Framework
 Coded UI is a Framework designed to provide
developers a way to:
 Interact with the AUD (application under test) Controls, to
get their state, values etc..
 Interact with the AUD (application under test) Controls, to
Set their state, values etc..
 Run their automatic TC (Test Cases).
Microsoft Coded UI
Framework
 Coded UI is a Framework can handle Controls of the
following types:
 WinForms
 HTML
 WPF (Windows Presentation Foundation)
 This is a big advantage of Coded UI because currently
the only other tool that handles Custom controls of
WPF is QTP.
Microsoft Coded UI
Framework
 Coded UI tests can be written in VB.NET (Visual Basic)
or in C# (C-Sharp).
 Coded UI tests can be run manually or automatically.
 Coded UI tests can be coded manually or by
recording Tests using the Coded UI Test Builder.
Microsoft Coded UI
Framework
 Using the KDT approach is up to the developer.
 Coded UI framework have very limited special
features to support coding with KDT in mind, but it is still
highly recommended.
Recording VS Manually
Automating
 In general, there are two ways to create Automatic
tests with the Coded UI framework.
 The first way is by using the “Coded UI Test Builder”
 recording your actions on the AUT and adding
assertions(Verifications) – all without any coding involved.
 In theory that could be great but unfortunately, currently, the
framework is not sufficient in recognizing custom controls,
and mapping large scale applications.
 Thus, this way is not applicable to our needs.
Recording VS Manually
Automating
 Moreover, even if the recording capabilities would meet our
needs, this way is not compatible with our KDT approach,
because, we will need to record each scenario from start to
end (no reuse of code).
 For example, if we need to add another step to some of our
CUITs, we will need to record those tests again, from scratch,
or we will need to manually code those actions and copy
past the code across all tests,
 Instead, by using KDT, we would just update one of our
Modules.
Recording VS Manually
Automating
 The second way is by implementing the code
manually.
What you need
(Prerequisites)
 Visual Studio 2010 Ultimate or Visual Studio 2010
Premium or newer versions of Visual Studio.
 SQL express (can be installed as part of the VS2010
installations).
Creating a new Coded UI Project
 Open Microsoft Visual Studio 2010 Ultimate (or newer)
 Start a new testing project: “File” -> “New Project…” .
 In the New Project window, select “Visual C#”->
“Test”, enter a name for the Project and press the OK
button to create the test project.
Creating a new Coded UI Project
Creating a new Coded UI Project
 Close the “UnitTest.cs” window
 R.click on the “UnitTest.cs” in the “Solution Explorer”
and select Delete.

More Related Content

What's hot

Coded ui - lesson 9 - test windows
Coded ui - lesson 9 - test windowsCoded ui - lesson 9 - test windows
Coded ui - lesson 9 - test windows
Omer Karpas
 
UI testing frameworks and the Coded UI testing paradigm
UI testing frameworks and the Coded UI testing paradigm UI testing frameworks and the Coded UI testing paradigm
UI testing frameworks and the Coded UI testing paradigm
Arnold Stellio
 
Coded ui - lesson 6 - manual coding
Coded ui - lesson 6 - manual codingCoded ui - lesson 6 - manual coding
Coded ui - lesson 6 - manual coding
Omer Karpas
 
Unit testing with visual studio 2012
Unit testing with visual studio 2012Unit testing with visual studio 2012
Unit testing with visual studio 2012Abhimanyu Singhal
 
Testing the User Interface - Coded UI Tests with Visual Studio 2010
Testing the User Interface - Coded UI Tests with Visual Studio 2010Testing the User Interface - Coded UI Tests with Visual Studio 2010
Testing the User Interface - Coded UI Tests with Visual Studio 2010
Eric D. Boyd
 
Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010
Clemens Reijnen
 
Test Tooling in Visual Studio 2012 an overview
Test Tooling in Visual Studio 2012 an overviewTest Tooling in Visual Studio 2012 an overview
Test Tooling in Visual Studio 2012 an overview
Clemens Reijnen
 
MTM Test Management System
MTM Test Management SystemMTM Test Management System
MTM Test Management SystemMinu Mishra
 
Testing with test_complete
Testing with test_completeTesting with test_complete
Testing with test_completebinuiweb
 
Coded ui - lesson 5 - ui map
Coded ui - lesson 5 - ui mapCoded ui - lesson 5 - ui map
Coded ui - lesson 5 - ui map
Omer Karpas
 
Testing tools in visual studio
Testing tools in visual studioTesting tools in visual studio
Testing tools in visual studio
Mahdi Esmailoghli
 
QA with Microsoft Test Manager and Lab Management
QA with Microsoft Test Manager and Lab ManagementQA with Microsoft Test Manager and Lab Management
QA with Microsoft Test Manager and Lab Management
Rofiqi Setiawan
 
TestComplete – A Sophisticated Automated Testing Tool by SmartBear
TestComplete – A Sophisticated Automated Testing Tool by SmartBearTestComplete – A Sophisticated Automated Testing Tool by SmartBear
TestComplete – A Sophisticated Automated Testing Tool by SmartBear
Software Testing Solution
 
Automation Testing with TestComplete
Automation Testing with TestCompleteAutomation Testing with TestComplete
Automation Testing with TestComplete
RomSoft SRL
 
Lab Management with TFS 2010
Lab Management with TFS 2010Lab Management with TFS 2010
Lab Management with TFS 2010
Ed Blankenship
 
Visual studio Team system 2012
Visual studio Team system 2012Visual studio Team system 2012
Visual studio Team system 2012
kunnathust
 
Getting started with_testcomplete
Getting started with_testcompleteGetting started with_testcomplete
Getting started with_testcompleteankit.das
 
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
 

What's hot (20)

Coded ui - lesson 9 - test windows
Coded ui - lesson 9 - test windowsCoded ui - lesson 9 - test windows
Coded ui - lesson 9 - test windows
 
UI testing frameworks and the Coded UI testing paradigm
UI testing frameworks and the Coded UI testing paradigm UI testing frameworks and the Coded UI testing paradigm
UI testing frameworks and the Coded UI testing paradigm
 
Coded ui - lesson 6 - manual coding
Coded ui - lesson 6 - manual codingCoded ui - lesson 6 - manual coding
Coded ui - lesson 6 - manual coding
 
Unit testing with visual studio 2012
Unit testing with visual studio 2012Unit testing with visual studio 2012
Unit testing with visual studio 2012
 
Testing the User Interface - Coded UI Tests with Visual Studio 2010
Testing the User Interface - Coded UI Tests with Visual Studio 2010Testing the User Interface - Coded UI Tests with Visual Studio 2010
Testing the User Interface - Coded UI Tests with Visual Studio 2010
 
Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010
 
Test Tooling in Visual Studio 2012 an overview
Test Tooling in Visual Studio 2012 an overviewTest Tooling in Visual Studio 2012 an overview
Test Tooling in Visual Studio 2012 an overview
 
MTM Test Management System
MTM Test Management SystemMTM Test Management System
MTM Test Management System
 
Testing with test_complete
Testing with test_completeTesting with test_complete
Testing with test_complete
 
Coded ui - lesson 5 - ui map
Coded ui - lesson 5 - ui mapCoded ui - lesson 5 - ui map
Coded ui - lesson 5 - ui map
 
Testing tools in visual studio
Testing tools in visual studioTesting tools in visual studio
Testing tools in visual studio
 
QA with Microsoft Test Manager and Lab Management
QA with Microsoft Test Manager and Lab ManagementQA with Microsoft Test Manager and Lab Management
QA with Microsoft Test Manager and Lab Management
 
Practical alm testing
Practical alm   testingPractical alm   testing
Practical alm testing
 
TestComplete – A Sophisticated Automated Testing Tool by SmartBear
TestComplete – A Sophisticated Automated Testing Tool by SmartBearTestComplete – A Sophisticated Automated Testing Tool by SmartBear
TestComplete – A Sophisticated Automated Testing Tool by SmartBear
 
Automation Testing with TestComplete
Automation Testing with TestCompleteAutomation Testing with TestComplete
Automation Testing with TestComplete
 
Test complete, work done so far
Test complete, work done so farTest complete, work done so far
Test complete, work done so far
 
Lab Management with TFS 2010
Lab Management with TFS 2010Lab Management with TFS 2010
Lab Management with TFS 2010
 
Visual studio Team system 2012
Visual studio Team system 2012Visual studio Team system 2012
Visual studio Team system 2012
 
Getting started with_testcomplete
Getting started with_testcompleteGetting started with_testcomplete
Getting started with_testcomplete
 
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...
 

Similar to Coded ui in a nutshell

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 ...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
 
Visual Studio 2015 / Visual Studio Team Services Overview
Visual Studio 2015 / Visual Studio Team Services OverviewVisual Studio 2015 / Visual Studio Team Services Overview
Visual Studio 2015 / Visual Studio Team Services Overview
Himanshu Desai
 
Inside Wijmo 5 - GrapeCity Echo 2016
Inside Wijmo 5 - GrapeCity Echo 2016Inside Wijmo 5 - GrapeCity Echo 2016
Inside Wijmo 5 - GrapeCity Echo 2016
Chris Bannon
 
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
Imaginet
 
Tutorial test driven development with Visual Studio 2012
Tutorial test driven development with Visual Studio 2012Tutorial test driven development with Visual Studio 2012
Tutorial test driven development with Visual Studio 2012
Hong Le Van
 
Better User Experience with .NET
Better User Experience with .NETBetter User Experience with .NET
Better User Experience with .NET
Peter Gfader
 
Inside Wijmo 5, a Large-scale JavaScript Product
Inside Wijmo 5, a Large-scale JavaScript ProductInside Wijmo 5, a Large-scale JavaScript Product
Inside Wijmo 5, a Large-scale JavaScript Product
Chris Bannon
 
Coding Naked
Coding NakedCoding Naked
Coding Naked
Caleb Jenkins
 
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
Justin Gordon
 
Full Testing Experience - Visual Studio and TFS 2010
 Full Testing Experience - Visual Studio and TFS 2010 Full Testing Experience - Visual Studio and TFS 2010
Full Testing Experience - Visual Studio and TFS 2010
Ed Blankenship
 
VB.Net GUI Unit_01
VB.Net GUI Unit_01VB.Net GUI Unit_01
VB.Net GUI Unit_01
Prashanth Shivakumar
 
What is Visual Studio Code?
What is Visual Studio Code?What is Visual Studio Code?
What is Visual Studio Code?
Mindfire LLC
 
Visual Studio 2010 Testing Overview
Visual Studio 2010 Testing OverviewVisual Studio 2010 Testing Overview
Visual Studio 2010 Testing Overview
Steve Lange
 
No More No Repro
No More No ReproNo More No Repro
No More No ReproAnna Russo
 
What's Coming in Visual Studio v.Next
What's Coming in Visual Studio v.NextWhat's Coming in Visual Studio v.Next
What's Coming in Visual Studio v.Next
Jeff Bramwell
 
STARWEST 2010 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2010 - 7 Steps To Improving Software Quality using Microsoft Test Ma...STARWEST 2010 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2010 - 7 Steps To Improving Software Quality using Microsoft Test Ma...Anna Russo
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
EffectiveUI
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
Effective
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
John Blanco
 

Similar to Coded ui in a nutshell (20)

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 ...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 ...
 
Visual Studio 2015 / Visual Studio Team Services Overview
Visual Studio 2015 / Visual Studio Team Services OverviewVisual Studio 2015 / Visual Studio Team Services Overview
Visual Studio 2015 / Visual Studio Team Services Overview
 
Inside Wijmo 5 - GrapeCity Echo 2016
Inside Wijmo 5 - GrapeCity Echo 2016Inside Wijmo 5 - GrapeCity Echo 2016
Inside Wijmo 5 - GrapeCity Echo 2016
 
Working in Visual Studio.Net
Working in Visual Studio.NetWorking in Visual Studio.Net
Working in Visual Studio.Net
 
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
 
Tutorial test driven development with Visual Studio 2012
Tutorial test driven development with Visual Studio 2012Tutorial test driven development with Visual Studio 2012
Tutorial test driven development with Visual Studio 2012
 
Better User Experience with .NET
Better User Experience with .NETBetter User Experience with .NET
Better User Experience with .NET
 
Inside Wijmo 5, a Large-scale JavaScript Product
Inside Wijmo 5, a Large-scale JavaScript ProductInside Wijmo 5, a Large-scale JavaScript Product
Inside Wijmo 5, a Large-scale JavaScript Product
 
Coding Naked
Coding NakedCoding Naked
Coding Naked
 
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
 
Full Testing Experience - Visual Studio and TFS 2010
 Full Testing Experience - Visual Studio and TFS 2010 Full Testing Experience - Visual Studio and TFS 2010
Full Testing Experience - Visual Studio and TFS 2010
 
VB.Net GUI Unit_01
VB.Net GUI Unit_01VB.Net GUI Unit_01
VB.Net GUI Unit_01
 
What is Visual Studio Code?
What is Visual Studio Code?What is Visual Studio Code?
What is Visual Studio Code?
 
Visual Studio 2010 Testing Overview
Visual Studio 2010 Testing OverviewVisual Studio 2010 Testing Overview
Visual Studio 2010 Testing Overview
 
No More No Repro
No More No ReproNo More No Repro
No More No Repro
 
What's Coming in Visual Studio v.Next
What's Coming in Visual Studio v.NextWhat's Coming in Visual Studio v.Next
What's Coming in Visual Studio v.Next
 
STARWEST 2010 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2010 - 7 Steps To Improving Software Quality using Microsoft Test Ma...STARWEST 2010 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2010 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 

Coded ui in a nutshell

  • 1. Coded UI in a nutshell Omer Karpas
  • 2. Abbreviations and Professional Terms (Glossary) Abbreviation or term Definition KDT Keywords Driven Testing AUT Application Under Test VS Visual Studio BB Building Block GUI Graphical User Interface VB Visual Basic CUIT Coded UI Test TC Test Case Scenario Synonym for Test Case
  • 3. Keyword Driven Testing  In KDT (keyword-driven testing), each keyword corresponds to an individual testing Action or Verification.  Examples:  A mouse click  Selection of a menu item  Keystrokes  Opening or closing a window  Verifying a control is visible  Verifying a control is enabled  Etc…
  • 4. Keyword Driven Testing  A keyword-driven test is a sequence of keywords, that simulate user actions on the AUT (Application Under Test).  Basically, to create a test, testers simply order the corresponding keywords of the desired Actions and Verifications.  Keywords are commonly called Modules or BB (Building Blocks).
  • 5. Keyword Driven Testing  Pros:  Reuse of code  Allows non-coding personals to build scenarios from the BB.  Much easier maintenance  Cons:  Takes more coding time  Conclusion – KDT is the way to go!
  • 6. Microsoft Coded UI Framework  “You can use Visual Studio 2010 Ultimate or Visual Studio 2010 Premium to create automated tests of the user interface (UI) known as coded UI tests. These tests provide functional testing of the user interface and validation of user interface controls. Automated UI tests enable you to test that the user interface is functioning correctly after code changes. They are quicker to run than manual tests. Therefore, you can run them more frequently.“ (MSDN)
  • 7. Microsoft Coded UI Framework  Coded UI is a Framework designed to provide developers a way to:  Interact with the AUD (application under test) Controls, to get their state, values etc..  Interact with the AUD (application under test) Controls, to Set their state, values etc..  Run their automatic TC (Test Cases).
  • 8. Microsoft Coded UI Framework  Coded UI is a Framework can handle Controls of the following types:  WinForms  HTML  WPF (Windows Presentation Foundation)  This is a big advantage of Coded UI because currently the only other tool that handles Custom controls of WPF is QTP.
  • 9. Microsoft Coded UI Framework  Coded UI tests can be written in VB.NET (Visual Basic) or in C# (C-Sharp).  Coded UI tests can be run manually or automatically.  Coded UI tests can be coded manually or by recording Tests using the Coded UI Test Builder.
  • 10. Microsoft Coded UI Framework  Using the KDT approach is up to the developer.  Coded UI framework have very limited special features to support coding with KDT in mind, but it is still highly recommended.
  • 11. Recording VS Manually Automating  In general, there are two ways to create Automatic tests with the Coded UI framework.  The first way is by using the “Coded UI Test Builder”  recording your actions on the AUT and adding assertions(Verifications) – all without any coding involved.  In theory that could be great but unfortunately, currently, the framework is not sufficient in recognizing custom controls, and mapping large scale applications.  Thus, this way is not applicable to our needs.
  • 12. Recording VS Manually Automating  Moreover, even if the recording capabilities would meet our needs, this way is not compatible with our KDT approach, because, we will need to record each scenario from start to end (no reuse of code).  For example, if we need to add another step to some of our CUITs, we will need to record those tests again, from scratch, or we will need to manually code those actions and copy past the code across all tests,  Instead, by using KDT, we would just update one of our Modules.
  • 13. Recording VS Manually Automating  The second way is by implementing the code manually.
  • 14. What you need (Prerequisites)  Visual Studio 2010 Ultimate or Visual Studio 2010 Premium or newer versions of Visual Studio.  SQL express (can be installed as part of the VS2010 installations).
  • 15. Creating a new Coded UI Project  Open Microsoft Visual Studio 2010 Ultimate (or newer)  Start a new testing project: “File” -> “New Project…” .  In the New Project window, select “Visual C#”-> “Test”, enter a name for the Project and press the OK button to create the test project.
  • 16. Creating a new Coded UI Project
  • 17. Creating a new Coded UI Project  Close the “UnitTest.cs” window  R.click on the “UnitTest.cs” in the “Solution Explorer” and select Delete.