🖋️
QualityMate
  • QualityMate
  • Getting Started
    • Introduction
    • Why QualityMate
    • Architecture
    • Supported Web Browsers
    • Glossary
  • Components
    • UI Player
      • Basic Concepts
      • UiPlayer
      • MSTest Integration
      • Samples
        • QualityMate Sample Desktop
        • QualityMate Sample Web
        • QualityMate MSTest Integration Sample Desktop
        • QualityMate MSTest Integration Sample Web
        • QualityMate Integration with Test Frameworks
        • Web Authentication Sample
      • QualityMate Project Template
    • UI Recorder
      • Basic Concepts
      • Setting Up the Recorder
      • Validating an Element
      • Generating QualityMate Solution
  • Tools
    • File Comparators
    • Image Processor
    • Project Merger
    • Test Case Generator
      • Filters
      • Rename Recorded Controls
  • Basic Concepts
    • Page Object
      • Work Guide
    • Controls
      • Control Types
        • Generic Types
        • Desktop types
        • Web Types
        • WebMap types
          • Kendo PowerBuilder
          • Kendo WinForms
          • Kendo Silverlight
      • Interactions
        • SendKeys
        • Validate
    • Selectors
      • Selectors in Code
      • Default Selector
      • Shared Selector
      • Selectors Category
        • CSS Selector
        • XPath Selector
        • Image Selector
        • Frame Selector
      • Identifying Selector
        • Identify for Windows Desktop
        • Identify for Web
  • How to Guides
    • Setting Up the Configuration
      • Parameters
      • Context
      • Loading External Data
    • Awaiting for the Application
      • Busy Loaders
      • Retries
    • Defining Controls
      • Extending Controls
      • Control Slice
      • Control Collection
    • Logging on Tests
      • QualityMate Reports
      • Logging
  • Help
    • Best Practices
      • Environment
      • Tests
      • Page Objects
      • Validations
      • Interactions
      • Image Comparisons
    • Known Issues
    • Continuous Integration
      • Agents Session
    • Upgrading QualityMate
      • From version 7 to version 8
      • Previous Versions
      • How to switch from TestFeature to UiTest
    • VS Test
      • Command Line
      • Generate Reports
  • API
    • Control Interfaces
      • IButton
      • ICheckBox
      • IComboBox
      • IControl
      • IControlSlice
      • IDateTimePicker
      • IElement
      • IGrid
      • IGroupBox
      • ILabel
      • IListBox
      • IMenu
      • INumericUpDown
      • IPageObject
      • IProgressBar
      • IRadioButton
      • IRadioButtonGroup
      • ISplitButton
      • IStatusStrip
      • ITab
      • ITextBox
      • IToggleButton
      • IToolBar
      • ITreeView
    • Behavior
      • ICheckableControl
      • IList
      • ITextControl
    • Enums
      • ClickType
      • KeyModifiers
      • MouseButton
  • Changelog
    • Changelog
      • Version 8
      • Version 7
      • Version 6
      • Version 5
      • Version 4
      • Version 3
Powered by GitBook
On this page
  • CSS Selector Attribute
  • Web Support
  • Desktop Support

Was this helpful?

  1. Basic Concepts
  2. Selectors
  3. Selectors Category

CSS Selector

PreviousSelectors CategoryNextXPath Selector

Last updated 2 years ago

Was this helpful?

CSS Selector Attribute

CSS Selectors are available via the Mobilize.QualityMate.Automation.Selectors namespace. Selectors must be set as control attributes:

[Selector("div > span > input")]
public IElement SomeInput { get; set; }

Web Support

All CSS selectors are supported for Web, which can be found on the following .

Desktop Support

The following subset of CSS selectors can be used on Desktop:

Selector
Example
Description

*

*

Selects all elements.

type

Button

Selects all elements via their control type.

.className

.WinFormsButton

Selects all elements via their class name.

type.className

Button.WinFormsButton

Selects all elements with the control type and class name specified.

#id

#AutomationID

Selects elements via their automation ID.

first, second

Button, Text

Selects all elements that match any selector listed, separated by a comma.

parent descendant

Pane Button

Selects all descendants within a parent element.

parent > child

Pane > Button

Selects all direct children within a parent element.

element ~ sibling

Button ~ Text

Selects all siblings after an element.

element + sibling

Button + Text

Selects all siblings placed immediately after an element.

[property='value']

[Name='ButtonName']

Selects all elements that have the exact property value specified.

[property~='value']

[Name~='ton']

Selects all elements that have a property which contains the value specified.

[property*='value']

[Name|='Button']

Equivalent to [property~='value'].

[property|='value']

[Name|='Button']

Selects all elements that have a property which starts with the value specified.

[property^='value']

[Name^='Button']

Equivalent to [property|='value'].

[property$='value']

[Name$='Name']

Selects all elements that have a property which ends with the value specified.

:nth-child(n)

:nth-child(1)

Selects the element at position n with respect to its siblings. The n value starts at 1.

selector:nth-child(n)

Button:nth-child(1)

Selects the nth element selected by any other selector specified. The n value starts at 1.

W3Schools article