I am using : java:1.8 Selenium: 3.141.59 jar Geco driver version: 0.25.0 Firefox version : 69.0.1
Below is the executable.bat file detail:
start java -jar C:/eclipse-workspace/Selenium_Grid/Config/selenium-server-standalone-3.141.59.jar -role hub
start java -Dwebdriver.chrome.driver=D:/Selenium/chromedriver_win32/chromedriver.exe -jar C:/eclipse-workspace/Selenium_Grid/Config/selenium-server-standalone-3.141.59.jar -role node -hub http://localhost:4444/grid/register -port 5558 -maxSession 5 -browser browserName=chrome,maxInstances=10
start java -Dwebdriver.gecko.driver=D:/Selenium/geckodriver-v0.25.0-win64/geckodriver.exe -jar C:/eclipse-workspace/Selenium_Grid/Config/selenium-server-standalone-3.141.59.jar -role node -hub http://localhost:4444/grid/register -port 5559 -maxSession 5
Configuration of Grid Hub and node
Below is the code :
public static RemoteWebDriver getBrowserDriver(final String browser)
throws MalformedURLException {
return new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"),
getBrowserCapabilities(browser));
}
private static DesiredCapabilities getBrowserCapabilities(
final String browserType) throws MalformedURLException {
switch (browserType.toLowerCase()) {
case "firefox":
System.out.println("Opening firefox driver");
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setBrowserName("firefox");
capabilities.setPlatform(Platform.WIN10);
return capabilities;
}
}
On running code getting below exception log :
org.openqa.selenium.WebDriverException: Error forwarding the new session Empty pool of VM for setup Capabilities {acceptInsecureCerts: true, browserName: firefox, marionette: true, platform: WIN10, version: } Command duration or timeout: 801 milliseconds Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48' System info: host: 'GP-PIN-IS04', ip: '192.168.250.72', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_221' Driver info: driver.version: RemoteWebDriver Caused by: org.openqa.grid.common.exception.GridException: Error forwarding the new session Empty pool of VM for setup Capabilities {acceptInsecureCerts: true, browserName: firefox,
1 Answer 1
So your error says "Error forwarding the new session Empty pool of VM for setup Capabilities" which means it is looking for a node that matches the capabilities you asked for when creating the remote driver, but it cannot find one. In the line that is starting your geckodriver, you are not specifying a browser like you are for the chrome one. Probably it would be easier to create a node config file and pass it in when starting the node like this:
java -Dwebdirver.gecko.driver="D:/Selenium/geckodriver-v0.25.0-win64/geckodriver.exe" -jar selenium-server-standalone-3.8.1.jar -role node -hub "http://localhost:4444/grid/register/" -port 5559 -nodeConfig config.json
Here is what the config file for your firefox node could look like:
{
"capabilities": [
{
"browserName": "firefox",
"platform": "WIN10",
"maxInstances": 5
}
],
"hub": "http://<hub ip>:<hub port>"
}
-
Thanks Shannon for reply, but still getting the same error even after using config way.Keshav– Keshav2019年09月23日 03:46:46 +00:00Commented Sep 23, 2019 at 3:46
-
Maybe try updating your grid jar? Looks like you are using a pretty old one.Shannon McRae– Shannon McRae2019年09月23日 12:51:18 +00:00Commented Sep 23, 2019 at 12:51
-
I am using 3.141.59 selenium server jar,also gecko driver 0.25.0 version, if these are the older one kindly guide me to latest jar download link.Keshav– Keshav2019年09月25日 04:36:08 +00:00Commented Sep 25, 2019 at 4:36
-
Hi Keshav, here is a link to download the latest grid jars. I am using 3.8.1 but they have also come out with Selenium 4 selenium-release.storage.googleapis.com/index.htmlShannon McRae– Shannon McRae2019年10月17日 13:23:47 +00:00Commented Oct 17, 2019 at 13:23
Explore related questions
See similar questions with these tags.
configuration
tab of the grid console, when taking the screenshot)