Selenium Grid +Error forwarding the new session Em

2020-07-10 19:33发布

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");
    }

4条回答
等我变得足够好
2楼-- · 2020-07-10 20:08

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

查看更多
Melony?
3楼-- · 2020-07-10 20:12

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)

查看更多
ゆ 、 Hurt°
4楼-- · 2020-07-10 20:28

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.

查看更多
冷血范
5楼-- · 2020-07-10 20:30

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
查看更多
登录 后发表回答