.isSelected()
Retrieves selected status of element. Please note that this is based on the accessibility state (React Native, Android, iOS) of the element. While the element may appear selected, this may not be the case to Appium.
Usage
element(matcher).isSelected()
Returns
Promise
(Boolean
): Element selected status.
Support
Platform | Supported |
---|---|
iOS | Yes (Appium 1.16.0+) |
Android | Yes |
Web | Yes |
Examples
Selected status of tab:
const { element, by, expect } = require("appdriver");
(async () => {
const selected = await element(by.label("tab"))
.isSelected();
return expect(selected).toBeTruthy();
})();