Default Selector

When a PageObject or Control does not have the Selector Attribute a Default Selector is used instead. The selector matches the class or property name with an element's id.

Example

You have a window with the id MyWindow, what you may think is to add the Selector to bind the PageObject or Control to the element. Instead of that, you could change the class name to MyWindow, and QualityMate will search as it has a selector.

Using Selector

[Selector("#MyWindow")]
public class MyPageObject : PageObject 
{}

Omitting Selector

public class MyWindow : PageObject 
{}

Recommendations

Use the default selector when you think the name represents the element that is binding for. If the id property it is not to significative, it is better to use a Selector than omitting it.

Last updated