【问题标题】:How can i increase session timeout (which is 30 minutes by default)如何增加会话超时(默认为 30 分钟)
【发布时间】:2015-06-09 14:31:37
【问题描述】:

我想以编程方式处理服务器超时。

我的代码是这样的。

SelendroidConfiguration config = new SelendroidConfiguration();
config.addSupportedApp("apk/test.apk");
selendroidServer = new SelendroidLauncher(config);

    URL url = new URL("http://localhost:4444/wd/hub");
    // -------------------------------------------------------
    SelendroidCapabilities test= SelendroidCapabilities
            .device("com.test.android:1.0");
    driver = new SelendroidDriver(url, test);

【问题讨论】:

  • 您要更改位于客户端的服务器端设置吗?

标签: selenium android-testing selendroid


【解决方案1】:

当测试开始失败时,我遇到了同样的问题。您已经设置了配置。只需添加这一行。

  config.setSessionTimeoutSeconds(60000);

【讨论】:

    【解决方案2】:

    您可以使用它来将其增加到 50 秒

    java -jar selendroid-standalone-0.11.0-with-dependencies.jar -timeoutEmulator 50000
    

    source

    【讨论】:

      【解决方案3】:

      解决这个问题的最可选方法是在 cmd 行中添加以下属性:“-timeout”。请记住,它的值应该以秒为单位(默认为 1800=30 分钟)。

      所以它看起来像这样:

      java -jar  -htmlSuite "various suite parameters" -timeout 3600
      

      因此,服务器应保持活动状态一小时而不是 30 分钟。有趣的是,这并没有很好的记录,而且很难找到一个合适的解决方案来改变这个设置。

      您可以在此处阅读更多信息: https://wiki.mozilla.org/Running_IDE_scripts_with_Selenium_RC

      【讨论】:

        猜你喜欢
        • 2010-09-29
        • 2011-10-18
        • 1970-01-01
        • 1970-01-01
        • 2014-04-17
        • 1970-01-01
        • 1970-01-01
        • 2013-11-23
        • 2018-07-26
        相关资源
        最近更新 更多