appium-xcuitest新增功能&遗留问题汇总

失效的功能:

  1. Setting geo location (https://github.com/appium/appium/issues/6856):无法获取屏幕大小
  2. Auto accepting/dismissing alerts (https://github.com/appium/appium/issues/6863):自动关闭弹窗(alerts)失效
  3. Touch Actions:touch操作不能使用

已知问题:

  1. click功能异常
  2. 摇一摇功能未实现(因苹果不支持了)
  3. 锁屏功能不支持
  4. 设置当前定位功能未实现
  5. zoom支持,pinch不支持

模拟器状态重置功能:

By default, this driver will create a new iOS simulator and run tests on it, deleting the simulator afterward.

默认情况下,会新建一个iOS模拟器然后在上面跑case,跑完后会删除该模拟器。

If you specify a specific simulator using the udid capability, this driver will boot the specified simulator and shut it down afterwards.

如果你通过udid属性指定一个特定的模拟器,该driver会启动该模拟器,最后关闭它。

If a udid is provided and the simulator is already running, this driver will leave it running after the test run.

如果提供udid的设备已经在执行自动化了,该driver会等它跑完后再跑。

In short, this driver tries to leave things as it found them.

一句话说,该driver尽量保证模拟器保持其初始状态。

You can use the noReset capability to adjust this behavior. Setting noReset to true will leave the simulator running at the end of a test session.

你可以使用noReset属性来适应这个情况。设置noReset值为true可以等模拟器跑完测试线程后再执行其他内容。

真机调试:

环境配置详见(https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md

已知问题:真机上多次运行失败后,可能不能再建立连接了,补救办法:capability中useNewWDA值为true

其他问题:在真机上跑测试很奇怪,如果停止响应,最常用的解决方法是重启手机,这种情况的log通常展示如下:

真机的签名设置:

在某些系统上会有accessbility限制导致WDA不能运行。这通常会在xcodebuild中返回标注65的错误。解决方法是使用一个不存储在系统钥匙链中的签名,详见(https://github.com/appium/appium/issues/6955http://stackoverflow.com/questions/16550594/jenkins-xcode-build-works-codesign-fails

导出签名,使用命令行:

security create-keychain -p [keychain_password] MyKeychain.keychain
security import MyPrivateKey.p12 -t agg -k MyKeychain.keychain -P [p12_Password] -A
(将MyPrivateKey.p12替换为从系统钥匙链导出来的个人开发者key)
使用keychainPath属性可以将这个钥匙链的路径发送给appium;使用keychainPassword属性可以将这个钥匙链的密码发送给appium。

 

参照:https://github.com/appium/appium-xcuitest-driver

附capabilities属性列表

Capability
Description
Values
noReset Do not destroy or shut down sim after test. Start tests running on whichever sim is running, or device is plugged in. Default false truefalse
processArguments Process arguments and environment which will be sent to the WebDriverAgent server. { args: ["a", "b", "c"] , env: { "a": "b", "c": "d" } } or '{"args": ["a", "b", "c"], "env": { "a": "b", "c": "d" }}'
wdaLocalPort This value if specified, will be used to forward traffic from Mac host to real ios devices over USB. Default value is same as port number used by WDA on device. e.g., 8100
showXcodeLog Whether to display the output of the Xcode command used to run the tests. If this is true, there will be lots of extra logging at startup. Defaults to false e.g., true
iosInstallPause Time in milliseconds to pause between installing the application and starting WebDriverAgent on the device. Used particularly for larger applications. Defaults to 0 e.g., 8000
xcodeOrgId Apple developer team identifier string. Must be used in conjunction with xcodeSigningId to take effect. e.g., JWL241K123
xcodeSigningId String representing a signing certificate. Must be used in conjunction with xcodeOrgId. This is usually just iPhone Developer, so the default (if not included) is iPhone Developer e.g., iPhone Developer
xcodeConfigFile Full path to an optional Xcode configuration file that specifies the code signing identity and team for running the WebDriverAgent on the real device. e.g., /path/to/myconfig.xcconfig
updatedWDABundleId Bundle id to update WDA to before building and launching on real devices. This bundle id must be associated with a valid provisioning profile. e.g., io.appium.WebDriverAgentRunner
keychainPath Full path to the private development key exported from the system keychain. Used in conjunction with keychainPassword when testing on real devices. e.g., /path/to/MyPrivateKey.p12
keychainPassword Password for unlocking keychain specified in keychainPath. e.g., super awesome password
scaleFactor Simulator scale factor. This is useful to have if the default resolution of simulated device is greater than the actual display resolution. So you can scale the simulator to see the whole device screen without scrolling. Acceptable values are: '1.0', '0.75', '0.5', '0.33' and '0.25'. The value should be a string.
usePrebuiltWDA Skips the build phase of running the WDA app. Building is then the responsibility of the user. Only works for Xcode 8+. Defaults to false. e.g., true
preventWDAAttachments Sets read only permissions to Attachments subfolder of WebDriverAgent root inside Xcode's DerivedData. This is necessary to prevent XCTest framework from creating tons of unnecessary screenshots and logs, which are impossible to turn off using programming interfaces provided by Apple. Setting the capability to truewill set Posix permissions of the folder to 555 and falsewill reset them back to 755true by default
webDriverAgentUrl If provided, Appium will connect to an existing WebDriverAgent instance at this URL instead of starting a new one. e.g., http://localhost:8100
useNewWDA If true, forces uninstall of any existing WebDriverAgent app on device. This can provide stability in some situations. Defaults to false. e.g., true
wdaLaunchTimeout Time, in ms, to wait for WebDriverAgewnt to be pingable. Defaults to 60000ms. e.g., 30000
wdaConnectionTimeout Timeout, in ms, for waiting for a response from WebDriverAgent. Defaults to 240000ms. e.g., 1000
resetOnSessionStartOnly Whether to perform reset on test session finish (false) or not (true). Keeping this variable set to true and Simulator running (the default behaviour since version 1.6.4) may significantly shorten the duratiuon of test session initialization. Either true or false. Defaults to true
commandTimeouts Custom timeout(s) in milliseconds for WDA backend commands execution. This might be useful if WDA backend freezes unexpectedly or requires too much time to fail and blocks automated test execution. The value is expected to be of type string and can either contain max milliseconds to wait for each WDA command to be executed before terminating the session forcefully or a valid JSON string, where keys are internal Appium command names (you can find these in logs, look for "Executing command 'command_name'" records) and values are timeouts in milliseconds. You can also set the 'default' key to assign the timeout for all other commands not explicitly enumerated as JSON keys. '120000''{"findElement": 40000, "findElements": 40000, "setValue": 20000, "default": 120000}'
wdaStartupRetries Number of times to try to build and launch WebDriverAgent onto the device. Defaults to 2. e.g., 4
wdaStartupRetryInterval Time, in ms, to wait between tries to build and launch WebDriverAgent. Defaults to 10000ms. e.g., 20000
connectHardwareKeyboard Set this option to true in order to enable hardware keyboard in Simulator. It is set to false by default, because this helps to workaround some XCTest bugs. true or false
maxTypingFrequency Maximum frequency of keystrokes for typing and clear. If your tests are failing because of typing errors, you may want to adjust this. Defaults to 60 keystrokes per minute. e.g., 30
simpleIsVisibleCheck Use native methods for determining visibility of elements. In some cases this takes a long time. Setting this capability to false will cause the system to use the position and size of elements to make sure they are visible on the screen. This can, however, lead to false results in some situations. Defaults to false, except iOS 9.3, where it defaults to true. e.g., truefalse
useCarthageSsl Use SSL to download dependencies for WebDriverAgent. Defaults to false e.g., true
shouldUseSingletonTestManager Use default proxy for test management within WebDriverAgent. Setting this to falsesometimes helps with socket hangup problems. Defaults to true. e.g., false
startIWDP Set this to true if you want to start ios_webkit_debug proxy server automatically for accessing webviews on iOS. The capatibility only works for real device automation. Defaults to false. e.g., true
allowTouchIdEnroll Set this to true if you want to enroll simulator for touch id. Defaults to false. e.g., true

 

 

 

 

 

 

 

 

 

 

 

 

 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值