1

I'm trying to automate the app , but suddenly in middle the google permissions window for permission like phone , location etc pops up , is there any way that I can make sure always permission pop ups are allowed

4

2 回答 2

2

Try to set desired capabilities:

autoAcceptAlerts = true
于 2016-07-14T10:25:41.630 回答
1

Since you said google permissions, I am assuming you are dealing in Android. Also since there is no language tag, I am sticking to Java, you can frame the logic in any language you are using.

Well, its sad to inform you that currently there seems to be no such capability added for android. Though iOS has few similar capabilities. So, for android what you can do is logically -

  1. If these pop-ups are device dependent, change the device settings that these pop-ups are not allowed.
  2. If these pop-ups are relevant to application permissions, then you must know when they would occur. Just keep a check -

    List<WebElement> popUp = driver.findElement(<find the pop up using your locator strategy>);
    if(popUp.size()!=0) {
      WebElement accept/dismiss = driver.findElement(<find the button accordingly>);
      accept/dismiss.click();
    }
    
于 2016-07-14T03:17:56.337 回答