Validate

Use of the Validate Extensions.

The ValidateExtensions allow us to verify states of the application that commonly changes on runtime. This makes interactions more resistant to common issues like slow responses, network issues, callbacks, and many others.

How it works

This extension method will repeatedly retry the validation until the amount of time specified by StepTimeout is fulfilled.

Validations can be used on:

  • Controls.

  • ControlCollections.

  • PageObjects.

  • UiExecutionController.

Usage

Import the following namespace on the class where you are going to validate.

using Mobilize.QualityMate.Automation.Extensions;

Call the Validate method when needed on the supported objects, for example:

Controls

MyPageObject.myControl.Validate(self => self.Text == "Something");

ControlCollections

MyPageObject.myCollection.Validate(self => self.Controls.Any());

PageObjects

MyPageObject.Validate(self => self.GetTitle() == "The title");

UiExecutionController

uiExecutionController.Validate(() => MyPageObject.MyControl.Text.Equals("Something"));

Unlike other validates, UiExecutionController doesn't need to use self.

For a better usage, check the Best Practices article related with Validations, you will find our recommendations.

Last updated