healenium / healenium-web

Self-healing library for Selenium Web-based tests
Apache License 2.0
170 stars 40 forks source link

Remove 0 content-length header to avoid error #247

Closed erikzimmermann closed 11 months ago

erikzimmermann commented 1 year ago

Version 3.4.6 of Healenium-Web breaks the initialization of reports (see error below). Removing the content-length header fixes this issue.

[http-nio-8080-exec-2] WARN healenium - [Init Report] Error during call. Message: non-positive contentLength: 0, Exception: {}
java.lang.IllegalArgumentException: non-positive contentLength: 0
    at java.net.http/java.net.http.HttpRequest$BodyPublishers.fromPublisher(HttpRequest.java:539)
    at org.openqa.selenium.remote.http.jdk.JdkHttpMessages.notChunkingBodyPublisher(JdkHttpMessages.java:137)
    at org.openqa.selenium.remote.http.jdk.JdkHttpMessages.createRequest(JdkHttpMessages.java:83)
    at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:369)
    at com.epam.healenium.client.RestClient.initReport(RestClient.java:257)
    at com.epam.healenium.SelfHealingEngine.initReport(SelfHealingEngine.java:189)
    at com.epam.healenium.SelfHealingDriver.callInitActions(SelfHealingDriver.java:66)
    at com.epam.healenium.SelfHealingDriver.create(SelfHealingDriver.java:49)
Alex-Reif commented 11 months ago

Hi, @erikzimmermann , thanks for your MR, we provide the same fix