Jauyzed
Jauyzed

Reputation: 511

Selenium Java - - RemoteWebDriver Error/exception

java version: 1.8

selenium version: latest as of april 2017

Hub/grid has been set up on a different machine which is a ec2 windows instance. A node successfully registers.

No erros on hub and node consoles. I can see the console on the browser with the registered node and browsers exposed.

java -Dwebdriver.gecko.driver=C:\selenium_grid\geckodriver\geckodriver.exe -jar selenium-server-standalone-3.4.0.jar -role hub -host <ipaddress> -port 4444

java -jar selenium-server-standalone-3.4.0.jar -role node -port 5555 -hub http://127.0.0.1:4444/grid/register -browser "browserName=firefox,platform=WINDOWS" -browser "browserName=opera,platform=WINDOWS" -browser "browserName=safari,platform=WINDOWS" -browser "browserName=internet explorer,platform=WINDOWS" -browser "browserName=chrome,platform=WINDOWS"


webdriver = new RemoteWebDriver(seleniumGridURL, desiredCapabilities);

public enum DriverType implements DriverSetup {

FIREFOX {
    public DesiredCapabilities getDesiredCapabilities(Proxy proxySettings) {
        DesiredCapabilities capabilities = DesiredCapabilities.firefox();
        capabilities.setCapability("marionette", true);
        return addProxySettings(capabilities, proxySettings);
    }

    public WebDriver getWebDriverObject(DesiredCapabilities capabilities) {
        return new FirefoxDriver(capabilities);
    }
}}`

Error: driver.version: RemoteWebDriver at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:353) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:159) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:137) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:174) at com.website.selenium.config.DriverFactory.instantiateWebDriver(DriverFactory.java:86) at com.website.selenium.config.DriverFactory.getDriver(DriverFactory.java:42) at com.website.selenium.DriverBase.getDriver(DriverBase.java:34) at com.website.selenium.listeners.ScreenshotListener.onTestFailure(ScreenshotListener.java:51) at org.testng.internal.Invoker.runTestListeners(Invoker.java:1716) at org.testng.internal.Invoker.runTestListeners(Invoker.java:1699) at org.testng.internal.Invoker.invokeMethod(Invoker.java:703) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

org.openqa.selenium.WebDriverException: Unable to parse remote response: Cannot POST /wd/hub/session

Trying to enable debug as suggested:
java -jar selenium-server-standalone-3.4.0.jar -debug -log c:\selenium_grid\grid.log -role node -port 5555 -hub http://127.0.0.1:4444/grid/register -browser "browserName=firefox,platform=WINDOWS" -browser "browserName=opera,platform=WINDOWS" -browser "browserName=safari,platform=WINDOWS" -browser "browserName=internet explorer,platform=WINDOWS" -browser "browserName=chrome,platform=WINDOWS"

Exception in thread "main" com.beust.jcommander.ParameterException: "-debug": couldn't convert "-log" to a boolean

Upvotes: 1

Views: 2174

Answers (1)

Jauyzed
Jauyzed

Reputation: 511

This was a networking issue with aws VPC's and private IP's and opening the TCP and UDP ports in windows firewall + modifying sec groups (incoming ports for windows machine) in the EC2 instance.

Upvotes: 1

Related Questions