Ryan
Ryan

Reputation: 1141

Inconsistent Selenium Grid Errors

I am running tests on Selenium grid - usually 5 machines running tests in parallel. I am getting some odd errors that aren't consistent. For example, one of my tests with about 600 iterations will finish with 0-50 of the 3 errors below. The number is different every time I run it. For each exception, the line it fails on is always the same.

  1. org.openqa.selenium.UnsupportedCommandException: Command duration or timeout: 65.91 seconds com.web.test.library.BaseTest.openUrl(BaseTest.java:45)

    Line #45 in BaseTest: remoteDriver.get(url);

  2. org.openqa.selenium.WebDriverException: Error forwarding the new session Error forwarding the request Read timed out Command duration or timeout: 134.11 seconds com.web.test.utility.DriverFactory.generateDriver(DriverFactory.java:46)

    Line #46 in DriverFactory: WebDriver driver = new RemoteWebDriver("my hub url here", capabilities);

  3. org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms com.web.test.utility.DriverFactory.generateDriver(DriverFactory.java:46)

    Line #46 in DriverFactory: WebDriver driver = new RemoteWebDriver("my hub url here", capabilities);

When I search for these errors online the fixes only help when this error is stopping every test. I can't find anything when it happens inconsistently like this. For example, the fix I found for #1 requires editing the host file. I don't think that is the problem in my case since it works ~95% of the time.

Upvotes: 3

Views: 1303

Answers (1)

Nathan Merrill
Nathan Merrill

Reputation: 8386

I'm guessing you are doing parallel testing using multiple threads.

If that is the case, I would recommend looking at ThreadGuard. It's a lightweight solution to make Webdriver thread safe.

If that doesn't work, then I imagine you are running into a networking overload problem (you are trying to do too many outgoing connections). How to fix such a problem, I don't know.

Upvotes: 2

Related Questions