Hi I add for button accessibility ID by code and in appium UI app source the ID Is displayed in name attribute and accessibilityId is null How can I add Id by code thanks
You can access the element’s ID via it’s name attribute. It is pretty much the same handle.
By.xpath("//*[@name='yourElement']) By.id("yourElement") Both code blocks above should reference the same element(s)
By.xpath("//*[@name='yourElement'])
By.id("yourElement")
For further information: