使用Appium-Android的BrowserStack-Automation不支持swipeGesture



使用BroswerStack(Android设备(用Appium测试移动原生应用程序,当尝试执行向上滑动手势时,它会抛出UnsupportedCommonException(请参见下文(。顺便说一句,它是在使用真实设备或模拟器的本地执行中工作的。

org.openqa.selenium.UnsupportedCommandException: Unknown mobile command "swipeGesture". 
Only shell,scrollBackTo,viewportScreenshot,deepLink,startLogsBroadcast,stopLogsBroadcast, 
acceptAlert,dismissAlert,batteryInfo,deviceInfo,changePermissions,getPermissions, 
performEditorAction,startScreenStreaming,stopScreenStreaming,getNotifications,listSms, 
type commands are supported.

我的代码如下

((JavascriptExecutor) driver).executeScript("mobile: swipeGesture", Map.of(
"left", location.x, "top", location.y - swipeBoxHigh,
"width", 100, "height", swipeBoxHigh,
"direction", "up",
"percent", 1,
"speed", 1500
));

知道我为什么在browswerStack中得到这个异常吗?

有什么建议如何在安卓系统中使用browserStack执行滑动手势吗?

您可以参考:https://www.browserstack.com/docs/app-automate/appium/advanced-features/appium-gestures用于在BrowserStack上使用滑动手势。

此外,请尝试使用不同的Appium版本,包括您在本地运行测试时使用的版本。寻求以下人员的帮助:https://www.browserstack.com/app-automate/capabilities

最新更新