0

I am trying to write selenium tests using Selenium-Jupiter. My team has decided to go with @TestTemplate approach and to use browsers.json.

One thing we feel we need to do is alter the default timeouts. I have read on the selenium documentation that you can use the shared capability "timeouts" to do so. We also know that you can specify capabilities in browsers.json.

I have ran out of ideas, I have tried the following two ways and neither sets timeouts correctly:

{
  "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}"
        }
      }
    ]
  ]
}

The former gets ignored and has no effect. The latter causes a failure when creating a WebDriver instance. I am starting to think this is not supported. :-(

Edit 1

I am using Java. Here is part of our 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>
Kreweta
  • 65
  • 1
  • 1
  • 6

1 Answers1

0

Currently, Selenium-Jupiter does not support that feature, sorry. The possible capabilities to be specified in the JSON scenario are simple key-value strings (see example).

Boni García
  • 4,618
  • 5
  • 28
  • 44