UiPlayer

The UiPlayer is a Singleton class, the automation engine responsible for reproducing user-interactions with an application with a user interface.

Execute

The way to tell QualityMate to perform the wanted steps is through the Execute method. This receives the UIPlayerConfiguration and an Action containing the steps.

UIPlayerConfiguration

Contains the parameters that allow you to change the default behavior of QualityMate, such as the ExecutionTimeout or the StepTimeout. The complete list of parameters is here.

UIExecutionController

The Action with the steps to be performed must receive the UIExecutionController. With it, you can interact with QualityMate and request PageObjects using the GetPageObject for example.

These are the exposed methods:

MethodSummary

Validate

Validates the given operation until it returns true or times out.

GetPageObject

Gets the PageObject specified.

TakeScreenshot

Take a screenshot.

Log

Logs a message to the log file.

Dispose

Cleanup the object.

These are the exposed properties:

PropertySummary

Configuration

Gets the Configuration Manager of the current execution.

ResultsPath

The location where the log, screenshot, or video are stored.

LogFilePath

The log file location.

VideoFilePath

The video file location.

WebManager

The manager used to interact with the browser.

UIExecutionResult

After performing the steps, Execute returns a UIExecutionResult. It contains whether it was successful or not, and any Exception thrown during execution.

These are the exposed properties:

PropertySummary

LogFilePath

The log file location.

ScreenshotFilePath

The screenshot file location.

VideoFilePath

The video file location.

Success

Indicates whether the execution has been completed successfully.

Exception

Stores the exception if it is thrown during the execution.

Code example

public void Run()
{
    UiPlayerConfiguration configuration = new UiPlayerConfiguration()
    {
        Technology = Technology.Desktop
    };

    // Here we pass the configuration and the Action with the steps to be performed.
    UiExecutionResult result = UiPlayer.Instance.Execute(configuration, this.ExecuteSteps);

    // After finishing the execution we can check the result.
    Console.WriteLine(result.Success);
}

private void ExecuteSteps(UiExecutionController controller)
{
    SimpleControlsPage simpleControlsPage = controller.GetPageObject<SimpleControlsPage>();
    // Here we write the interactions executed to the application under test.
}

How to use UiPlayer?

You can use the UiPlayer with the NuGet Mobilize.QualityMate.UiPlayer. For more information on how to use the UiPlayer, follow this link.

UiPlayer supports to automate one or both technologies combined (Desktop/Web).

The default output will be: {assembly}\UiPlayerResults\{yyyy-MM-dd_HH-mm-ss}\ If the OutputPath parameter changes, the path will be the following: {OutputPath}\

Last updated