5

I have two machines, one with all the stuff I need (Eclipse + TestNG +scripts) and the other one with just browsers installed. I use Selenium Grid 2.35.0.

Everything seems to be fine except the problem that very often I get this error: Error communicating with the remote browser. It may have died.

Scripts are not complicated at all, I run them one-by-one, so it just happens randomly. I don't think it's because of the browser. Any idea/fix? If you need more info I'm here.

user1
  • 945
  • 2
  • 13
  • 37
user1944151
  • 353
  • 1
  • 4
  • 16
  • 1
    I see this issue as well, via Behat/Selenium tests. The browser window is open, and the script was driving the session just fine until it suddenly dies with the error message. – Don Simon Oct 01 '13 at 21:09

3 Answers3

2

The only time I get that error is when I manually close the browser myself. I would verify that the machine withe the browsers is stable.

It could also be due to calling driver.quit() and not instantiating another driver (I haven't ever done this, so I don't know what error this throws)

Nathan Merrill
  • 7,648
  • 5
  • 37
  • 56
0

I notice this error as well but ONLY when using Selenium grid (using 2.35 but 2.38 exists now)

When I run locally I don't get error communicating with the browse but typically it can happen when there is a bug with your setup and teardown code (maybe one of your classes creates an instance of your browser before your setup function gets called)

Jason
  • 193
  • 2
  • 12
0

See How to close child browser window in Selenium WebDriver using Java

ensure to call driver.close(); on every popup / new windows / new tab you open during the test (after switching to it using driver.switchTo())

and to call driver.quit(); at the end of the session (generally in @AfterClass annotated method)

Community
  • 1
  • 1
Gab
  • 7,869
  • 4
  • 37
  • 68