Code Monkey home page Code Monkey logo

cuite's Introduction

What is CUITe?

CUITe (Coded UI Test enhanced) Framework is a thin layer developed on top of Microsoft Visual Studio Team Test's Coded UI Test engine which helps reduce code, increases readability and maintainability, while also providing a bunch of cool features for the automation engineer.

Supported technologies

  • HTML
  • WPF
  • WinForms
  • Silverlight

Supported Visual Studio versions

  • Visual Studio 2010 Ultimate or Premium with Feature Pack 2
  • Visual Studio 2012 Ultimate or Premium
  • Visual Studio 2013 Ultimate or Premium
  • Visual Studio 2015 Enterprise

Installation

Install CUITe using NuGet and make sure you include prerelease packages.

Install CUITe using the NuGet Package Manager

If your intent is to test HTML you might also want to install Selenium components for Coded UI Cross Browser Testing.

The NuGet package to install depends on the Visual Studio version you are using.

CUITe in Visual Studio 2010

Installing CUITe for HTML, WPF and WinForms:

Install-Package CUITe.VS2010 -Pre

Install CUITe for Silverlight:

Install-Package CUITe.Silverlight.VS2010 -Pre

CUITe in Visual Studio 2012

Installing CUITe for HTML, WPF and WinForms:

Install-Package CUITe.VS2012 -Pre

Install CUITe for Silverlight:

Install-Package CUITe.Silverlight.VS2012 -Pre

You should also install the extension Microsoft Visual Studio 2012 Coded UI Test Plugin for Silverlight.

CUITe in Visual Studio 2013

Installing CUITe for HTML, WPF and WinForms:

Install-Package CUITe.VS2013 -Pre

Install CUITe for Silverlight using the NuGet Package Manager:

Install-Package CUITe.Silverlight.VS2013 -Pre

You should also install the extension Microsoft Visual Studio 2013 Coded UI Test Plugin for Silverlight.

CUITe in Visual Studio 2015

Installing CUITe for HTML, WPF and WinForms:

Install-Package CUITe.VS2015 -Pre

Install CUITe for Silverlight using the NuGet Package Manager:

Install-Package CUITe.Silverlight.VS2015 -Pre

You should also install the extension Microsoft Visual Studio 2015 Coded UI Test Plugin for Silverlight.

Using CUITe

As best practice, we recommend writing object repositories for a more object-oriented approach to testing. Object repositories can more easily be created using the object recorder instead of manually creating them for HTML web pages. For more information see Recording objects using the CUITe Object Recorder or more code examples here.

Here are simple examples of testing filling out a form:

HTML

// Launch the web browser and navigate to the homepage
BrowserWindowUnderTest browserWindow = BrowserWindowUnderTest.Launch("https://website.com");

// Enter the first name
browserWindow.Find<HtmlEdit>(By.Id("FirstName")).Text = "John";

// Enter the last name
browserWindow.Find<HtmlPassword>(By.Id("LastName")).Text ="Doe";

// Click the Save button
browserWindow.Find<HtmlInputButton>(By.Id("Save")).Click();

WPF

// Launch the application
ApplicationUnderTest.Launch(@"C:\path to your application.exe");

// Find the main window of your application
WpfWindow window = new WpfWindow(By.Name("Main Window Title"));

// Enter the first name
window.Find<WpfEdit>(By.Name("FirstName")).Text = "John"

// Enter the last name
window.Find<WpfEdit>(By.Name("LastName")).Text = "Doe";

// Click on the Save button
window.Find<WinButton>(By.Name("Save")).Click();

WinForms

// Launch the application
ApplicationUnderTest.Launch(@"C:\path to your application.exe");

// Find the main window of your application
WinWindow window = new WinWindow(By.Name("Main Window Title"));

// Enter the first name
window.Find<WinEdit>(By.Name("FirstName")).Text = "John"

// Enter the last name
window.Find<WinEdit>(By.Name("LastName")).Text = "Doe";

// Click on the Save button
window.Find<WinButton>(By.Name("Save")).Click();

Silverlight

// Launch the browser where the silverlight application is hosted
BrowserWindowUnderTest browser = BrowserWindowUnderTest.Launch("https://website.com");

// Enter the first name
browser.Find<SilverlightEdit>(By.AutomationId("FirstName")).Text = "John";

// Enter the last name
browser.Find<SilverlightEdit>(By.AutomationId("LastName")).Text = "Doe";

// Click on the Save button
browser.Find<SilverlightButton>(By.AutomationId("Save")).Click();

Recording objects using the CUITe Object Recorder

The CUITe Object Recorder supports recording objects from an HTML web page only.

  1. Launch the CUITe Object Recorder from the location where the NuGet package was installed.

    For example, launch /packages/CUITe.VS2013.x.x.x/tools/CUITe_ObjectRecorder.exe, relative to your solution.

  2. Enter the full address of your web page in the Address field (ex. http://website.com).

  3. Click on the 'Record' button.

  4. Click on the objects you want to record actions against.

  5. Click on the 'Code' button.

  6. Copy the code and paste it in a new file in your Coded UI Test project.

  7. Change the placeholder '$ProjectNameSpace$' with your namespace.

  8. Use the class and generated code in a more object-oriented fashion:

// Launch the web page
MyObjectRepository browserWindow = BrowserWindowUnderTest.Launch<MyObjectRepository>("https://website.com");

// Enter the first name
browserWindow.FirstName.Text = "John";

// Enter the last name
browserWindow.LastName.Text ="Doe";

// Click on the Save button
browserWindow.Save.Click();

cuite's People

Contributors

ankisaxena avatar fantasticfiasco avatar icnocop avatar thepantz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.