我正在尝试使用 CodeceptJS(它使用 Appium)来测试原生 Android 应用程序。我想使用 I.seeElement 方法来查看是否存在一个字段,但 Appium 服务器似乎只是挂起而没有错误消息。
这一步是输入电话号码,以便用户登录。在此之前我已经能够单击一个按钮,但那是因为我能够使用简单的文本标识符。
这是我写的。(I.click 方法在单击按钮时起作用。)
// in this file you can append custom step methods to 'I' object
module.exports = function() {
return actor({
login: function (I) {
I.click('ALLOW');
I.seeElement('#com.[package name removed]:id/phone');
}
});
}
这是错误消息:
[HTTP] --> POST /wd/hub/session/5e57e7af-ca1c-46bf-94ac-7e2f113a26fa/elements
[HTTP] {"using":"xpath","value":"//*[@resource-id='com.[package name removed]:id/phone']"}
[debug] [W3C (5e57e7af)] Calling AppiumDriver.findElements() with args: ["xpath","//*[@resource-id='com.[package name removed]:id/phone']","5e57e7af-ca1c-46bf-94ac-7e2f113a26fa"]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//*[@resource-id='com.[package name removed]:id/phone']","context":"","multiple":true}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//*[@resource-id='com.[package name removed]:id/phone']","context":"","multiple":true}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding '//*[@resource-id='com.[package name removed]:id/phone']' using 'XPATH' with the contextId: '' multiple: true