Subramanian Raghavan
Subramanian Raghavan

Reputation: 13

WebDriver Exception while running Selenium Tests on Remote Standalone server: org.openqa.selenium.WebDriverException: Unable to parse remote response

I have two personal laptops. Laptop A is the client from where I am running Selenium tests through Eclipse IDE. The tests are to be executed on Laptop B which runs the standalone server. Both laptops run Windows 10

To run Selenium Standalone server on Laptop B, I use the following command:-

java -jar selenium-server-standalone-3.141.59.jar -role standalone

The configuration steps I took:-

  1. On Laptop B, the selenium server jar and the webdriver [geckodriver] are kept in the same folder
  2. I have included the path to this folder in the PATH system environment variable on Laptop B
  3. Both laptops are able to ping each other over my home wifi-fi

For Laptop B:

IPv4 Address: 192.168.1.9
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1

For Laptop A:

IPv4 Address: 192.168.1.5
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
  1. Once the standalone server is started on Laptop B, I am able to access the console page of standalone server from Laptop A from browser. Like so:-

http://192.168.1.9:5555/console

  1. I use TestNG to run my Selenium test from Eclipse. The Test class has @BeforeClass annotated method like so:-
    @BeforeClass
    public void beforeClass() throws MalformedURLException, InterruptedException {
    FirefoxOptions firefoxOptions = new FirefoxOptions(); 
    firefoxOptions.setCapability("browserName", "firefox");
    firefoxOptions.setCapability("platformName", "WIN10");
    firefoxOptions.setCapability("marionette", true);
    webdriver = new RemoteWebDriver(new URL("http://192.168.1.9:5555"), firefoxOptions);
     ...
     ..
     .
}

I get the following error while running Selenium Tests [the standalone server's console HTML page is returned in error response]:-

FAILED CONFIGURATION: @BeforeClass beforeClass 
org.openqa.selenium.WebDriverException: Unable to parse remote response: <!DOCTYPE html> 
<html lang="en"> 
<head> 
<meta charset="UTF-8">
...

Notes:-

I got the same error when I tried with different browsers/webdriver combinations as given below:-

  1. Chrome Browser version 81.x.x
  2. FireFox Browser version 75.x
  3. ChromeDriver versions 76.x,80.x,81.x,83.x
  4. GeckoDriver versions 0.23.0, 0.26.0
  5. While using ChromeDriver, I ensure the following are taken care of:-

    a.On Laptop B, the selenium server jar and the webdriver [chromedriver] are kept in the same folder

    b.I have included the path to this folder in the PATH system environment variable on Laptop B

    c.TestNG annotated test class:-

 @BeforeClass
 public void beforeClass() throws MalformedURLException, InterruptedException {
 ChromeOptions chromeOptions = new ChromeOptions();
 chromeOptions.setCapability("browserName", "chrome");
 chromeOptions.setCapability("browserVersion", "81.x.x"); //76.x,80.x,81.x,83.x
 chromeOptions.setCapability("platformName", "WIN10");
 webdriver = new RemoteWebDriver(new URL("http://192.168.1.9:5555"), chromeOptions);
 }

The end result is that the browsers are not invoked on laptop B and the tests not run

I searched the web (including Stackoverflow) but couldn't find a resolution to this error. Any inputs will be highly appreciated

Upvotes: 1

Views: 947

Answers (2)

UnknownBeast
UnknownBeast

Reputation: 979

Please check the below for Selenium Grid configuration. It makes the procedure of configuring the selenium grid very easy and the part of this utility is it can increase and decrease the node automatically. If you face any issue while configuring the selenium grid then please drop me an email [email protected] I will love to solve that issue on screen share.

https://github.com/frostyaxe/Talongrid

Upvotes: 0

Alexandr Plekhov
Alexandr Plekhov

Reputation: 1

Looks like you have wrong remote URL. Let's try: http://192.168.1.9:5555/wd/hub

Upvotes: 0

Related Questions