首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >麻烦: setConnection(Connection.AIRPLANE)

麻烦: setConnection(Connection.AIRPLANE)
EN

Stack Overflow用户
提问于 2017-06-05 21:10:06
回答 1查看 606关注 0票数 0

我尝试在Android模拟器上设置飞行模式,但执行后得到:

代码语言:javascript
复制
org.openqa.selenium.WebDriverException: undefined status object (WARNING: The server did not provide any stacktrace information)

我的代码:

代码语言:javascript
复制
public static void enableAirplaneMode(){
        driver.setConnection(Connection.AIRPLANE);
        assertEquals(Connection.AIRPLANE, driver.getConnection());
        classLogger.log(Level.INFO, "Connection type is set: " + driver.getConnection());
    }

在仿真器上启用了两种模式--> driver.setConnection(Connection.AIRPLANE);-->之后,我在仿真器设置(飞机和数据)而不是飞机上看到了它。并且执行失败了:

代码语言:javascript
复制
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:635)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at io.appium.java_client.CommandExecutionHelper.execute(CommandExecutionHelper.java:32)
at io.appium.java_client.android.AndroidDriver.setConnection(AndroidDriver.java:230)
at core.screen_driver.ConfigureEmulatorOS.enableAirplaneMode(ConfigureEmulatorOS.java:33)
at step_definitions.GeneralDefs.enableAirplane(GeneralDefs.java:109)

也许有人有解决这个案子的办法?

EN

回答 1

Stack Overflow用户

发布于 2017-06-06 21:31:11

在中使用Connection.AIRPLANE

代码语言:javascript
复制
driver.setConnection(Connection.AIRPLANE);

仅适用于android 6.0及更高版本(适用于Emulator)

有关driver.setConnection()的参考,请参阅appium文档

https://appium.readthedocs.io/en/stable/en/writing-running-appium/network_connection/

我还建议更新到最新的java-client和appium服务器。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44369729

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档