QualityMate Sample Desktop

What does this guide cover?

  • Creation of a basic application using QualityMate on a desktop application.

  • The proper solution structure that you should use.

  • The QualityMate NuGets that you need.

  • A simple Page Object and application to run.

The completed sample solution described in this article can be downloaded here:

Desktop QualityMate Sample

Before this guide

This guide assumes that you will use our asset application.

4KB
Open
Download Desktop Sample App

Set up your application environment

To create our first Application with QualityMate, we're going to:

  1. Create a console C# project using the .Net Framework version 4.6.1 or higher and name it HelloWorldUiPlayer. If you're working on Visual Studio, information on how to do this can be found here.

  2. Create an Assets folder inside the project folder.

  3. Decompress the downloaded assets in the Assets folder.

  4. Set the assets files to copy to the output directory. To do this, open your project file (HelloWorldUiPlayer.csproj) and add the following lines:

  5. Add the Mobilize.QualityMate.UiPlayer package through the NuGet package manager.

The project folder structure should look like the following example:

Describe the UI of the target application

It's time to create our first Page Object; we're going to do the following:

  1. Create a folder named PageObjects inside the project folder.

  2. Create a C# class file namedForm1.cs inside the PageObjets folder.

  3. Add the following usings in the Form1.cs file:

  4. Create the UI controls that we are going to use on Form1 class like the following:

The fields specified in the code snip above represent each UI control of the assets' application.

Create a new UI script

Once we have a PageObject, we can create a new QualityMate script:

  1. Create a HelloWorld.cs file inside the application folder.

  2. Add the following using statements in the HelloWorld.cs file:

  3. Create the class HelloWorld that will contain our execution script.

  4. Create a UiPlayerConfiguration property that will hold the UiPlayer parameters.

  5. Create the method HelloWorldScript(UiExecutionController controller), this method will let us interact with the UI using the controller with the next code:

  6. Create the method ExecuteHelloWorld(), we're going to use this method to start the UiPlayer like the following example:

Run the application

On the Main() function create a new HelloWorld object to call the method ExecuteHelloWorld

Finally, launch the application and see the magic happen. Great isn't it?

Last updated

Was this helpful?