I’m automating an Android App using Appium. The issue I’m facing is it doesn’t perform any action after tabbing on allow button of Contact Access Permission as shown in below Image :
I’ve tried below code for the same :
@Test public void doLogin() { driver.findElement(By.id("com.rawalinfocom.rcontact:id/text_next")).click(); // Clicks on Allow Button driver.findElement(By.id("com.android.packageinstaller:id/permission_allow_button")).click(); // Clicks on Skip link driver.findElement(By.id("com.rawalinfocom.rcontact:id/text_skip")).click(); driver.findElement(By.id("com.rawalinfocom.rcontact:id/checkbox_terms_conditions")).click(); driver.findElement(By.id("com.rawalinfocom.rcontact:id/button_get_started")).click(); driver.findElement(By.id("com.rawalinfocom.rcontact:id/input_number")).sendKeys("9422307801"); driver.findElement(By.id("com.rawalinfocom.rcontact:id/button_submit")).click(); driver.findElement(By.id("com.rawalinfocom.rcontact:id/input_enter_password")).sendKeys("1234"); driver.findElement(By.id("com.rawalinfocom.rcontact:id/button_login")).click(); System.out.print("Login Success"); }
I’m newbie in Appium. How can I find the missing thing?
Answer
I’m able to handle the popup by setting up below capabilities :
capabilities.setCapability("autoGrantPermissions", "true"); capabilities.setCapability("autoAcceptAlerts", "true");
In this case it doesn’t show the popup the permission set always granted.