Selenium Grid +Error forwarding the new session Empty pool of VM for setup Capabilities
Asked Answered
G

4

6

I am trying a POC on selenium grid. I am receiving this error :

Error forwarding the new session Empty pool of VM for setup Capabilities [{browserName=chrome, version=47, platform=WIN8_1}]

Below is the code :

BeforeTest
    public void setup() throws MalformedURLException{
        nodeURL="http://localhost:4444/wd/hub";
        DesiredCapabilities capabilities = DesiredCapabilities.chrome();
        capabilities.setBrowserName("chrome");
        capabilities.setVersion("47");
        capabilities.setPlatform(Platform.WIN8_1);
        extent = new ExtentReports("./extentReport.html",true,DisplayOrder.NEWEST_FIRST);
        System.setProperty("webdriver.chrome.driver", "<path>\\chromedriver.exe");
        driver = new RemoteWebDriver(new URL(nodeURL),capabilities);
        //driver = new ChromeDriver(capabilities);
        driver.manage().window().maximize();
        driver.get("http://www.qaonlinetraining.com");
    }
Gnathous answered 11/12, 2015 at 6:41 Comment(0)
T
5

I just did a small tweak.

1). I launched the command prompt in "admin mode". 2). Gave the java path as "cd C:\Program Files (x86)\Java" in it 3). Then ran the command as "java -jar selenium-server-standalone-3.0.1.jar" without specifying any role

and Vollaaaa...it got fixed...!!!

Thanks to all of you for your help...Was after this error for last 3 days...a great relief must say.. :-)

Checkout this link for more information on how to do this... https://mcmap.net/q/1913958/-quot-an-unhandled-exception-of-type-39-system-invalidoperationexception-39-occurred-in-webdriver-dll-quot-error-coming-up

Tidewaiter answered 13/2, 2017 at 16:4 Comment(1)
Tried the same approach but no luck..have posted new question here (#68128228). Would love to hear thoughtsGrote
C
0

May be you have to get rid of -role hub option while setting up the node. Look at the discussion in this link.

https://github.com/angular/protractor/issues/1226

Note: Launch the command prompt in admin mode.

Ceciliacecilio answered 11/12, 2015 at 9:9 Comment(3)
I received another error FAILED CONFIGURATION: @BeforeTest setup org.openqa.selenium.WebDriverException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from chromedriver.storage.googleapis.com/index.html I tried with 2.46.0 , 2.48.2, 2.43.0 jars of seleniumGnathous
I guess the initial error with grid is resolved. Now have you downloaded chromedriver correctly to the path you have mentioned in your code? File file = new File("C:/Selenium/chromedriver.exe"); System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());Ceciliacecilio
I did that but it didn't helped.Gnathous
M
0

Launch Selenium-server-standalone with below commands as hub and node.

For hub:

java -jar selenium-server-standalone-2.48.2.jar -role hub

For node (Chrome):

java -jar selenium-server-standalone-2.48.2.jar -role node  -hub http://localhost:4444/grid/register -browser "browserName=chrome,maxinstance=1,platform=WINDOWS" -Dwebdriver.chrome.driver=C:\Selenium\chromedriver.exe
Manvel answered 11/12, 2015 at 9:19 Comment(4)
Please elaborate your answer a bit. Its not clear why and how.Nock
I received another error FAILED CONFIGURATION: @BeforeTest setup org.openqa.selenium.WebDriverException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from chromedriver.storage.googleapis.com/index.html I tried with 2.46.0 , 2.48.2, 2.43.0 jars of seleniumGnathous
I did this too. File file = new File("C:/Selenium/chromedriver.exe"); System.setProperty("webdriver.chrome.driver", file.getAbsolutePath()); But it didn't helped.Gnathous
Supply chrome driver path while initiating the node like below. Edited my answer to reflect the same. java -jar selenium-server-standalone-2.48.2.jar -role node -hub localhost:4444/grid/register -browser "browserName=chrome,maxinstance=1,platform=WINDOWS" -Dwebdriver.chrome.driver=C:\Selenium\chromedriver.exeManvel
S
-1

For hub execute the command as java -jar selenium-server-standalone-3.141.59.jar -port 8080

For node execute the command as java -Dwebdriver.chrome.driver="C:\program files\chromedriver.exe" -jar selenium-server-standalone-3.141.59.jar -role node -hub http://ipaddress:portnumber/grid/register -port 5556

To Remember (Do not specify the role for hub)

Syndrome answered 29/3, 2020 at 4:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.