In my script, there is this element taking sometime for being enabled to get clicked. We are unsure about the time it needs. Can you please help us?

We are unsure how much time it is taking to be available as some other element is hovering it for sometime.

Hello Dipen,

Please make use of the below method to wait for the element until it is available. Once you locate the element, it will get clicked. Ensure that you wait for the maximum needed time.

WebDriverWait wait = new WebDriverWait(driver, 30);
              wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//android.widget.Button[@index=\"2\"]"))).click();