selenium和浏览器之间的连接断开连接获得Below Error

时间:2017-06-30 07:05:20

标签: java firefox selenium-webdriver cucumber cucumber-jvm

当只有浏览器启动并且没有执行任何操作并退出浏览器然后低于错误。

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.

当浏览器启动并执行1或2个操作并退出浏览器时。 PFB用于错误跟踪。

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]

1 个答案:

答案 0 :(得分:0)

您可以将代码发布到TestNGZucchiniRunner吗?看起来它有阵列问题。