【发布时间】:2020-06-30 11:56:31
【问题描述】:
我们正在探索用于移动 APP 测试的空手道。在应用程序的某些部分,我们需要滚动下拉选择选项或需要使用 TouchActions 来按下返回按钮。空手道有没有办法实现 TouchActions 或 scrollIntoView。
谢谢, 谢卡尔
【问题讨论】:
标签: karate
我们正在探索用于移动 APP 测试的空手道。在应用程序的某些部分,我们需要滚动下拉选择选项或需要使用 TouchActions 来按下返回按钮。空手道有没有办法实现 TouchActions 或 scrollIntoView。
谢谢, 谢卡尔
【问题讨论】:
标签: karate
此时不支持TouchActions,但mobile commands 应该在develop 分支中工作。
请求您查看 https://github.com/intuit/karate/wiki/Developer-Guide 以构建它并验证它是否工作或应该在下一个 RC 构建中可用 0.9.6.RC4
使用移动命令滚动:
script("mobile: scroll", {direction: 'down'} )
由于您没有提到它是Android 还是iOS,如果这适用于您的驱动程序类型,请参考移动命令页面
【讨论】:
Testing on android version 9.0 emulator appium version :- 1.17.1 command :- script("mobile:scroll",{strategy : '-android uiautomator' , selector : "-android.widget.TextView[text='Argentina']"})Error:- "Unknown mobile command \"scroll\". Only shell,scrollBackTo,viewportScreenshot,deepLink,startLogsBroadcast,stopLogsBroadcast,acceptAlert,dismissAlert,batteryInfo,deviceInfo,...
Android :(。可以使用此解决方法调用未实现的驱动程序函数https://github.com/intuit/karate/tree/develop/examples/ui-test#webdriver-tips .. 检查这是否有帮助。否则您可能必须等到karate 中的实现已准备就绪
谢谢巴布 如果我们使用如下的 driver.script 就可以了;
driver.script("mobile: scroll", { "strategy" : "accessibility id", "selector": "Lists"}) “列表”在这里是它的定位器。 唯一的限制是在此滚动中使用有限的选择器支持。
Android 你只能使用:accessibility id, class name, -android uiautomator iOS 你只能使用:predicateString
【讨论】: