簡體   English   中英

是否可以使用Java在Appium中處理iOS本機應用程序權限

[英]Is it possible to handle iOS native app permissions in appium using java

我已經參考了appium文檔以獲得所需的功能。

http://appium.io/docs/en/writing-running-appium/caps/

對於android,存在autoGrantPermissions功能,但對於iOS應用,未找到處理應用權限的功能。

如果有任何解決方法或任何方法可以處理iOS的本機應用程序權限,請提出建議。

注意:在appium檢查器中,其顯示為“此元素不可用交互”

處理權限的一種方法可以是接受關閉傳入的警報(我使用的是ruby):

def alert_accept
  $driver.execute_script("mobile: alert", {
    'action': "accept"
  });
end

def alert_dismiss
  $driver.execute_script("mobile: alert", {
    'action': "dismiss"
  });
end

下面的代碼段對我有用

https://discuss.appium.io/t/xcuitestdriver-autoacceptalerts/13761/11

try {
driver.switchTo().alert().accept();
}
catch (NoAlertPresentException e) {
logger.warn("Alert is not present" + e.getMessage());
}

您可以通過功能來實現。 嘗試使用autoAcceptAlerts。

IOSMobileCapabilityType.AUTO_ACCEPT_ALERTS

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM