QualityMate Sample Web
What does this guide cover?
Creation of a basic application using QualityMate on a web browser.
The proper solution structure that you should use.
The QualityMate NuGets that you need.
A simple Page Object and application to run in a web browser.
The completed sample solution described in this article can be downloaded here:
Before this guide
This guide assumes that you will use our asset application.
Set up your application environment
To create our first Application with QualityMate, we're going to:
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.Create an
Assets
folder inside the project folder.Decompress the downloaded asset in the
Assets
folder.Set the assets files to copy to the output directory. To do this, open your project file (
HelloWorldUiPlayer.csproj
) and add the following lines: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:
Create a folder named
PageObjects
inside the project folder.Create a
Form1.cs
file inside thePageObjets
folder.Add the following usings in the
Form1.cs
file:Create the UI controls that we are going to use on
Form1
class like the following:
Create a new UI script
Once we have a PageObject, we can create a new QualityMate script:
Create a
HelloWorld.cs
file inside theapplication
folder.Add the following using statements in the
HelloWorld.cs
file:Create the class
HelloWorld
that will contain our execution script.Create a
UiPlayerConfiguration
property inside that class that will hold the UiPlayer parameters.Create the method
HelloWorldScript(UiExecutionController controller)
, this method will let us interact with the UI using the controller with the next code: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?