问题
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");
}
回答1:
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://stackoverflow.com/a/42187314/7551276
回答2:
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
回答3:
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.
来源:https://stackoverflow.com/questions/34217563/selenium-grid-error-forwarding-the-new-session-empty-pool-of-vm-for-setup-capab