Appium: Any work around to use ids of an element to automate the app

Viewed 6532

I am using Appium for testing mobile application.When I use xpath it is working fine but I am not able to work on Ids for that app.

//This is working fine

remoteDriver.findElementByXPath("/linear[1]/window[2]/linear[1]/linear[1]/linear[2]/linear[1]/text[2]").click(); // Click on signIn button 

// This doesn't recognize the element

remoteDriver.findElementById("ButtonSignIn").click(); // Click on signIn button

If anybody has experience on appium using ids then please share your experience.

Thanks

6 Answers
Related