Repository navigation
CSS selector support
Adds CSS selectors as a first-class locator strategy using the css= prefix. CSS locators integrate with QWeb's automatic waits, frame traversal, indexing and open Shadow DOM support.
Added
- CSS locators with the
css\=prefix for the Element keywords,GetWebElement,GetAttribute,VerifyAttribute,GetCoordinates,GetText,VerifyElementText, the input keywords (TypeText,TypeSecret,VerifyInputValue,VerifyInputStatus,VerifyInputElement,GetInputValue,UploadFile,PressKey),ClickCheckboxandDropDown. Acss\=locator waits, uses the same visibility rules, searches all frames and picks a match withindex. See CSS locators. :has-text()and:text-is()filters at the end of acss\=locator. Matching is case-sensitive, andPartialMatchandCaseInsensitivedo not apply. If one match contains another, only the innermost is kept. See CSS specific text filters- With
ShadowDOMon,css\=searches open shadow roots. The selector stays inside one tree. On Salesforce Lightning synthetic shadow,css\=finds the same elements as XPath withShadowDOMleft off. A real open shadow root still needs the setting. See CSS and Shadow DOM intro or more generic Shadow DOM documentation.
Changed
element_type=cssis deprecated. It still works and logs a warning. Use thecss\=prefix.- A
css\=locator with invalid syntax fails immediately instead of waiting out the timeout. - Missing tkinter no longer stops QWeb from importing on macOS and Windows. The
DEV_MODEpause still needs tkinter and is skipped, with a warning, when it is missing. Linux still needs tkinter.
Fixed
- UploadFile with an index locator now finds the file input across frames and inside a shadow root.
- ClickCheckbox clicks the parent of a visually hidden checkbox (1×1 px,
display: none,visibility: hiddenoropacity: 0) when no label wraps it, so the page receives a click. Setting.checkedis still the last step.
Removed
- Official support for Python 3.10, which has reached end of life. Supported versions are 3.11–3.14.