我正在尝试用selenium -木星来编写Selenium测试。我的团队决定采用@TestTemplate方法并使用browsers.json。
我们觉得我们需要做的一件事是改变默认的超时。我读过关于可以使用共享功能的selenium文档“超时”的文章。我们还知道,您可以在browsers.json中指定功能。
我的想法用完了,我尝试了以下两种方法,但都没有正确设置超时:
{
"browsers": [
[
{
"type": "edge",
"version": "latest",
"capabilities": {
"timeouts": {"implicit": 10000, "pageLoad": 10000, "script": 30000}
}
}
]
]
}{
"browsers": [
[
{
"type": "edge",
"version": "latest",
"capabilities": {
"timeouts": "{\"implicit\": 10000, \"pageLoad\": 10000, \"script\": 30000}"
}
}
]
]
}前者被忽视,没有任何效果。后者在创建WebDriver实例时会导致失败。我开始认为这是不支持的。:-(
编辑1
我正在使用Java。这里是我们pom.xml的一部分
<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>发布于 2022-02-18 13:28:56
目前,硒木星不支持这一功能,对不起。JSON场景中可能指定的功能是简单的键值字符串(请参阅示例)。
https://stackoverflow.com/questions/70800242
复制相似问题