首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >硒-木星-在browsers.json中的传递超时

硒-木星-在browsers.json中的传递超时
EN

Stack Overflow用户
提问于 2022-01-21 11:02:46
回答 1查看 25关注 0票数 0

我正在尝试用selenium -木星来编写Selenium测试。我的团队决定采用@TestTemplate方法并使用browsers.json

我们觉得我们需要做的一件事是改变默认的超时。我读过关于可以使用共享功能的selenium文档“超时”的文章。我们还知道,您可以在browsers.json中指定功能。

我的想法用完了,我尝试了以下两种方法,但都没有正确设置超时:

代码语言:javascript
复制
{
  "browsers": [
    [
      {
        "type": "edge",
        "version": "latest",
        "capabilities": {
           "timeouts": {"implicit": 10000, "pageLoad": 10000, "script": 30000}
        }
      }
    ]
  ]
}
代码语言:javascript
复制
{
  "browsers": [
    [
      {
        "type": "edge",
        "version": "latest",
        "capabilities": {
           "timeouts": "{\"implicit\": 10000, \"pageLoad\": 10000, \"script\": 30000}"
        }
      }
    ]
  ]
}

前者被忽视,没有任何效果。后者在创建WebDriver实例时会导致失败。我开始认为这是不支持的。:-(

编辑1

我正在使用Java。这里是我们pom.xml的一部分

代码语言:javascript
复制
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>5.8.2</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>4.1.1</version>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.github.bonigarcia</groupId>
            <artifactId>selenium-jupiter</artifactId>
            <version>4.0.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
EN

回答 1

Stack Overflow用户

发布于 2022-02-18 13:28:56

目前,硒木星不支持这一功能,对不起。JSON场景中可能指定的功能是简单的键值字符串(请参阅示例)。

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

https://stackoverflow.com/questions/70800242

复制
相关文章

相似问题

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