0

I am testing different configurations for selenium grid 4 and in the official documentation is said that reject-unsupported-caps = true will "Allow the Distributor to reject a request immediately if the Grid does not support the requested capability."

To test the configuration locally I have hub and node with the following configurations:

#hubConfig.toml
[server]
port = 4444

[distributor]
healthcheck-interval = 10
reject-unsuported-caps = true

[logging]
structured-logs = true
log-file = "log/hubLog.log"
log-encoding = "UTF-8"
log-level = "CONFIG"
#nodeConfig.toml
[server]
port = 6666

[node]
detect-drivers = true
max-sessions = 2
heartbeat-period = 10
session-timeout = 300
hub = "http://localhost:4444"

[logging]
structured-logs = true
log-file = "log/nodeLog.log"
log-encoding = "UTF-8"
log-level = "CONFIG"

I am executing single test class maven/java/TestNG containing 3 tests. Two with correct capabilities(chrome,firefox) and one in safari. Example for the second test is below

@Test
public void test2() throws InterruptedException {
    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setCapability(BROWSER_NAME,"safari");
    RemoteWebDriver remoteWebDriver = new RemoteWebDriver(gridURL,caps);
    remoteWebDriver.get("http://www.google.com");
    Thread.sleep(sleepTime);
    remoteWebDriver.quit();
}

My expectation is that this test should be rejected immediately, but it fails after session timeout.

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure
  • Quick question, are your chrome & firefox nodes spinning up on demand? Or are they always available ? – djmonki Feb 05 '23 at 05:07
  • Hi @djmonki, thank you for your question. For the testing scenario described above I have one Hub and two Nodes running locally on my machine which is with Windows 10 and it doesn't have safari. For the real case is almost the same but Hub and all the nodes are running on Windows 10 VMs. Hub and each of the nodes are on different VMs. – Stayko Mitev Feb 05 '23 at 09:45
  • Is that your actual hub.toml, there is a missing 'p' for unsupported - look ```reject-unsuported-caps = true``` - is this the reason why ? – djmonki Feb 06 '23 at 04:51
  • @djmonki, Thanks for spotting the issue. That was it ... one missing "p". – Stayko Mitev Feb 06 '23 at 08:59

0 Answers0