You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WebDriverAgent currently defines the following element attributes:
name - The actual value of element's accessibility identifier or element's label if the first one is not set
value - Element's value. It is always of type string (or nil if the value is not set) and contains the value of the corresponding element. Depending on the element's type this could be: a text or a placeholder text in the text field; a label of a text label; '1' or '0' if this is a checkbox or a switch
label - Element's label value or nil if it is not present
rect - Element's rectangle as a dictionary with the following keys: x, y, width, heigth
type - Type string. All the possible element types are enumerated on this XCTest tutorial page.
enabled - Whether the element is enabled or not (1/0)
visible - Whether the element is displayed or not (1/0)
accessible - Whether the element is accessible or not (1/0)
accessibilityContainer - Whether the element is an accessibility container or not (1/0)
All these attribute names can be used in predicate queries also with wd prefixes, for example wdName.
Examples
type == 'XCUIElementTypeButton' AND value BEGINSWITH[c] 'bla' AND visible == 1 - find elements of type XCUIElementTypeButton whose value starts with Bla/bla/BLA and which are visible
type IN {'XCUIElementTypeIcon','XCUIElementTypeImage'} AND visible == 1 - find all visible icons and images
type == 'XCUIElementTypeCell' AND rect.width > 100 - find all cells whose width is greater than 100
type == 'XCUIElementTypeCheckBox' AND (visible == 1 OR enabled == 1) - find all check boxes, which are visible or enabled