Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 937
Ryan Avatar asked Aug 28 '26 10:08

Ryan


1 Answers

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.

like image 106
Nathan Merrill Avatar answered Aug 31 '26 00:08

Nathan Merrill



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!