我花了很多时间使用关于解决此问题的正确功能的普遍观点。
在 Java 上:
Map<String, Object> prefs = new HashMap<String, Object>();
prefs.put("credentials_enable_service", false);
prefs.put("profile.password_manager_enabled", false);
options.setExperimentalOption("prefs", prefs);
或者其他:
options.addArguments("--disable-save-password-bubble");
对我来说从来没有工作得很好。
系统配置:
- Java:jdk1.8.0_131
- Selenium :3.0.1
- Appium:1.6.5
最佳答案
我解决了问题,但不是能力。我将系统配置与此对齐:
- ChromeDriver:2.31.488763 (2.31)
- Apk(对于模拟器):59.0.3071.125
模拟器上的 apk 版本和 appium 使用的 ChromeDriver 版本似乎很重要。
我正在使用此功能:
ChromeOptions options = new ChromeOptions();
options.addArguments("--disable-extensions", "test-type",
"no-default-browser-check", "ignore-certificate-errors",
"--disable-notifications",
"--disable-offer-store-unmasked-wallet-cards",
"--disable-autofill-keyboard-accessory-view");
options.addArguments("--disable-translate");
关于java - 如何在 ChromeDriver 使用 Appium 和 Android Studio 上禁用保存密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45856371/