Stack Exchange
Connection between selenium and browser is getting disconnected getting Below Error
When only browser is launching and not performing any actions and quiting the browser then getting below Error.
Caused by: org.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 105; received: 0
    at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:180) ~[httpcore-4.4.3.jar:4.4.3]
Caused by: org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.

When browser is launching and performing 1 or 2 actions and quiting the browser.
PFB for error trace.
java.lang.ArrayIndexOutOfBoundsException: 123
        at org.openqa.selenium.internal.Base64Encoder.mapCharToInt(Base64Encoder.java:89)
        at org.openqa.selenium.internal.Base64Encoder.decode(Base64Encoder.java:76)
        at org.openqa.selenium.OutputType$2.convertFromBase64Png(OutputType.java:57)
        at org.openqa.selenium.OutputType$2.convertFromBase64Png(OutputType.java:55)
        at org.openqa.selenium.OutputType$3.convertFromBase64Png(OutputType.java:75)
        at org.openqa.selenium.OutputType$3.convertFromBase64Png(OutputType.java:73)
        at org.openqa.selenium.firefox.FirefoxDriver.getScreenshotAs(FirefoxDriver.java:343)
    10:59:31.659 [Firefox] ERROR c.c.zucchini.AbstractZucchiniTest - ERROR running test:
    cucumber.runtime.CucumberException: java.lang.ArrayIndexOutOfBoundsException: 123
        at com.comcast.zucchini.TestNGZucchiniRunner.runCukes(TestNGZucchiniRunner.java:80) ~[zucchini-2.2.9.jar:2.2.9]
        at com.comcast.zucchini.AbstractZucchiniTest.runWith(AbstractZucchiniTest.java:255) ~[zucchini-2.2.9.jar:2.2.9]
        at com.comcast.zucchini.TestRunner.run(TestRunner.java:51) [zucchini-2.2.9.jar:2.2.9]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 123
        at org.openqa.selenium.internal.Base64Encoder.mapCharToInt(Base64Encoder.java:89) ~[selenium-api-2.49.1.jar:na]
        at org.openqa.selenium.internal.Base64Encoder.decode(Base64Encoder.java:76) ~[selenium-api-2.49.1.jar:na]
        at org.openqa.selenium.OutputType$2.convertFromBase64Png(OutputType.java:57) ~[selenium-api-2.49.1.jar:na]
        at org.openqa.selenium.OutputType$2.convertFromBase64Png(OutputType.java:55) ~[selenium-api-2.49.1.jar:na]
        at org.openqa.selenium.OutputType$3.convertFromBase64Png(OutputType.java:75) ~[selenium-api-2.49.1.jar:na]
        at org.openqa.selenium.OutputType$3.convertFromBase64Png(OutputType.java:73) ~[selenium-api-2.49.1.jar:na]
        at org.openqa.selenium.firefox.FirefoxDriver.getScreenshotAs(FirefoxDriver.java:343) ~[selenium-firefox-driver-2.49.1.jar:na]


Can you post the code to TestNGZucchiniRunner? It looks like it's having an issue with an array.

I have not added any array code in ZucchiniRunner File. Moreover, I have just extends AbstractZucchiniTest class in my RunnerFile.

This should be a comment, not an answer

@KyleFairns I don't have enough reputation to comment, so I have mention in answer.

KyleFairns @helgi, I guess, there is already an issue in selenium.
I have refer this, but there is no solution given in this ticket. could you please let me know how to resolve this issue?
https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/5014
