I have a Android Native UI where I have:
Now I want to create a selector for this element in WebdriverIO where I can use contains unique-ID. I tried following but nothing worked.
'strategy': 'css selector',
'strategyVal': '[id*="unique-ID"]'
'strategy': 'css selector',
'strategyVal': '[id*=unique-ID]'
'strategy': 'xpath',
'strategyVal': '//*[contains(@id, "unique-ID")]'
'strategy': 'xpath',
'strategyVal': '//*[@id*="unique-ID"]'
'strategy': 'xpath',
'strategyVal': '//*[contains(@id, "unique-ID")]'
Any suggestion is appreciated.
After doing some debugging I came to know it was taking some time to load UI. After waiting for few seconds, below locator strategy worked.
'strategy': 'xpath',
'strategyVal': '//android.view.ViewGroup[contains(@resource-id, "unique-ID")]'