Control Collection

A ControlCollection can be used to select multiple controls using a single selectorarrow-up-right.

When to use

The collection can be useful in scenarios like:

  • A group of controls with similar characteristics.

  • Interactions that should be done on multiple elements.

How to use

Collection declaration on PageObject

    [Selector("CheckBox")]
    public ControlCollection<ICheckBox> checkBoxCollection { get; set; }

Usage in code

    foreach (var checkBox in MyPageObject.checkBoxCollection)
    {
        checkBox.Checked = true;
    }
circle-info

The collection can be navegated with Linq, foreach or by using the.controls property.

circle-info

To know the Best Practices using Control Collection, you can check this article.

Last updated

Was this helpful?