How to click on custom tag resource id on automation using appium

I have resource id as <custom_tag resource_id="@id/test_id"> </custom_tag>

I want to click using android automation using selenium, java and appium.
i have tried following ways but it not works.
Please anyone help on this…

  1. driver.findElementById(“test_id”).click()
  2. driver.findElementByXpath("//*[@id="@id/test_id"]").click();

please help on this.

Are you working on Mobile (Native or Hybrid app)?

your first statement looks good.

As far as xpath is concerned, just remove the “@id/” from xpath (before “test_id”)

Please make sure you have correct driver and correct context (native or webview)