What selector to use in WebDriverIO with Appium and MacOS Driver?

Viewed 619

I'm using Appium/WebDriverIO/MacOS to test a React-Native project (it runs on MacOS). I haven't been able to figure out the correct selector to use to find a UI element.

For a React functional component, what prop will I have to set on it to be able to select it? And how can I select it from the tests itself?

I've tried using WebDriverIO's $ selector, but it hasn't worked, saying the locator strategy is not supported for this session

1 Answers

$ != selector

$ is a short form of findElement , what selector strategy to use depends on what format you use:

example, $('~someaccessibilityid')

https://webdriver.io/docs/selectors/

Note: See what all selectors the underlying driver or server like appium supports and use it. For example winappdriver doesn't support css , so you cannot use css strategy

read this to know all available selector strategy

Related