Last updated 2 years ago
Was this helpful?
A ControlCollection can be used to select multiple controls using a single .
The collection can be useful in scenarios like:
A group of controls with similar characteristics.
Interactions that should be done on multiple elements.
Collection declaration on PageObject
[Selector("CheckBox")] public ControlCollection<ICheckBox> checkBoxCollection { get; set; }
Usage in code
foreach (var checkBox in MyPageObject.checkBoxCollection) { checkBox.Checked = true; }
The collection can be navegated with Linq, foreach or by using the.controls property.
.controls
To know the Best Practices using Control Collection, you can check article.