Appium in infinite looping

I am using driver to click an object:


Now appium would try finding this element infinitely, how can restrict the appium retries.

Similary when I am using waits, wait is not throwing timeout errors

Since Appium relies on Selenium libraries in the background, you can use Selenium to restrict that and cause your script to timeout after a certain amount of time when failing to find the object. Refer to this for help.

This is exactly what you need to do:

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);