我在代码中为AVD设置了这些功能。
AND 6.0.0 API 23:
capabilities.SetCapability(AndroidMobileCapabilityType.Avd, “AND_6.0.0_1080x1920_4.95in”);
capabilities.SetCapability(MobileCapabilityType.PlatformName, “Android”);
capabilities.SetCapability(MobileCapabilityType.DeviceName, “AND_6.0.0_1080x1920_4.95in”);
capabilities.SetCapability(MobileCapabilityType.PlatformVersion, “6.0”);
capabilities.SetCapability(MobileCapabilityType.Language, Session.Language);
capabilities.SetCapability(MobileCapabilityType.Locale, Session.Locale);
capabilities.SetCapability(MobileCapabilityType.App, app);
和7.0.0 API 24:
capabilities.SetCapability(AndroidMobileCapabilityType.Avd, “AND_7.0.0_1080x1920_4.95in”);
capabilities.SetCapability(MobileCapabilityType.PlatformName, “Android”);
capabilities.SetCapability(MobileCapabilityType.DeviceName, “AND_7.0.0_1080x1920_4.95in”);
capabilities.SetCapability(MobileCapabilityType.PlatformVersion, “7.0”);
capabilities.SetCapability(MobileCapabilityType.Language, Session.Language);
capabilities.SetCapability(MobileCapabilityType.Locale, Session.Locale);
capabilities.SetCapability(MobileCapabilityType.App, app);
语言为“cs”或“en”,Locale为“CZ”或“US”。
当我在AND 6.0.0上运行测试时,我可以在每次启动时更改语言,但在AND 7.0.0上,语言每次都设置为英语。
请问哪里有问题?我想在AND 7.0.0上更改语言。我还有AND 5和4的功能及其工作,但在AND 7和8上它不起作用。
很可能你遇到了change locale on SDK 24+ with appium 1.7.2问题
作为解决方法,您有两个选择:
npm install -g [email protected]
appium-android-driver
1.37.1中进行了修改,所以我猜测它肯定会在1.7.3-beta中。