WebDriverException: Error forwarding the new session cannot find : {platform=WINDOWS, browserName=FIREFOX, version=3.6}
Asked Answered
T

6

7

I am new to Selenium Web driver as well as Grid 2.

I am trying to run a test case but it gives me an exception

Exception in thread "main" org.openqa.selenium.WebDriverException: Error forwarding the new session cannot find : {platform=WINDOWS, browserName=FIREFOX, version=3.6}

I have started a node and hub using command

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

java -jar selenium-server-standalone-2.29.0.jar -role node  -hub %grid register%

Both the command works fine.

I am not sure when and where I need to use the command line -browser browserName=firefox,version=3.6,maxInstances=5,platform=WINDOWS

(Tried to configure the node from Grid 2 official page

Is it because of this?

Here is my code:

package test;

import java.net.URL;
import java.net.MalformedURLException;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.WebDriverBackedSelenium;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;

public class Test { 
    public static void main(String[] args) throws MalformedURLException {
        DesiredCapabilities capability = DesiredCapabilities.firefox();
            capability.setBrowserName("FIREFOX");
            capability.setPlatform(org.openqa.selenium.Platform.WINDOWS);
            capability.setVersion("3.6");
    //  capability.setCapability("");
        WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability);
        //WebDriver driver = new FirefoxDriver();
        driver.get("http://www.google.com"); 

}
}
Touzle answered 14/3, 2013 at 13:46 Comment(0)
A
6

For Registering Node, with a specific browserr configuration u have to use the below line from command prompt:

java -jar selenium-server-standalone-2.32.0.jar -role node -hub http://xxx.xxx.xxx.xxx:4444/grid/register -browser browserName=firefox

Replace the xxx with the actual ip address

Anachronistic answered 29/5, 2013 at 9:23 Comment(0)
Q
1

I think it is due to capability.setBrowserName("FIREFOX");

should be capability.setBrowserName("firefox");

Qoph answered 13/6, 2013 at 23:10 Comment(0)
D
1

you can check url http://localhost:4444/grid/console , if already selenium grid is up and running but need to check whether any node is registered or not !!(i.e check any browser is register or not)

if not you need to register selenium node using below command java -jar selenium-server-standalone-x.xx.0.jar -role node -hub http://localhost:4444/grid/register

make sure firefox browser is installed on the machine and geckodriver is present on the Path.

sometimes if you already running selenium hub using docker container you need to kill docker container using docker kill $(docker ps -q);

If you are running webdriverio then check docker selenium container running status .

Damnatory answered 17/2, 2019 at 6:56 Comment(0)
D
0

I also faced the same issue. It got solved,the problem was with the port 4444. which was blocked. So creating a Global IP for my system and allowing port 4444 worked for me.

Dewayne answered 28/1, 2014 at 5:41 Comment(0)
S
0

It is probably just what it says: the hub/selenium can not find a match for the requested capabilities.

I had this issue, and the error a got was (after formatting):

java.lang.RuntimeException : org.openqa.selenium.WebDriverException : Error forwarding the new session cannot find : Capabilities[{
        proxy = {
            proxyAutoconfigUrl = null,
            socksUsername = null,
            socksPassword = null,
            autodetect = false,
            httpProxy = xxxxxxxxxxxx.com : 8080,
            proxyType = MANUAL,
            noProxy = xxxxxxxxxxxxx.net,
            ftpProxy = null,
            hCode = 1273131486,
            socksProxy = null,
            class = org.openqa.selenium.Proxy,
            sslProxy = xxxxxxxxxxxxxx.com : 8080
        },
        loggingPrefs = org.openqa.selenium.logging.LoggingPreferences @ 3564e4e9,
        browserName = MicrosoftEdge,
        type = regular,
        version = ,
        platform = ANY
    }
]

Turns out that my co-workers had added a new parameter to the capabilities ("type"), and I had not updated my .json file that configures my Selenium node.

Scuttle answered 14/10, 2016 at 14:50 Comment(0)
P
-1

If you run parallel test. Increate thread-count and increase hub memory

cat /proc/sys/kernel/threads-max
echo 100000 > /proc/sys/kernel/threads-max
Pelf answered 18/11, 2015 at 13:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.