Is using testID Good or bad practice for automating Mobile Application?

797 views Asked by At

I am automating React Native Application and to reduce flakiness of the UI test I am using testID.

In the Detox automation, it is showing to use testID: https://github.com/wix/Detox/blob/master/docs/Troubleshooting.RunningTests.md#cant-find-my-component-even-though-i-added-testid-to-its-props

I have worked on Appium and it also asks us to use a unique ID.

My question is "using testID Good or bad practice for automating Mobile Application" is there anything else we can do?

1

There are 1 answers

0
Waweru Mwaura On BEST ANSWER

short answer: always use testIds they make your life as a tester easy. With TestID's you know what element has what name and you have control over the elements under test, even when the selector elements are modified by devs or they are autogenerated, the testIds do not change.