Hello,
when I am in the android settings app (settings of app to control notifications) I can only target the elements by xpath, and not by the id (accessabilityId ?).
Relevant code:
const settingsStatusHeaderElement = await Element.getElement(
this.settingsAppHeaderIdentifier, // tried xpath, id
this.settingsAppHeaderAccessorType // tried xpath, id or accessabilityId
);
await settingsStatusHeaderElement.isExisting();
await settingsStatusHeaderElement.isDisplayed();
Log file says this:
invalid selector: The selector “com.android.settings:id/collapsing_toolbar” used with strategy “css selector” is invalid! For more information on selectors visit the WebdriverIO docs at: https://webdriver.io/docs/selectors
at processTicksAndRejections (node:internal/process/task_queues:96:5)
This is how the element is targeted
public static async getElementByAccessibilityId(id) {
return $(`${id}`);
}
public static async getElementByXpath(xpath) {
return $(xpath);
}
public static async getElementById(id) {
return $(`#${id}`);
}