How to stop invalid length warning in Selenium?

Sometimes when you start selenium, a message similar to:

WARN - Invalid length: Content-Length = 798242, written = 8192

And then Selenium stops responding. The automation-driven website runs on ASP.NET and is served through IIS.

How to prevent selenium from stopping due to any error?

+3
source share
2 answers

URLs can only be long. There are strict restrictions defined in the RFC. I suspect that you are issuing a command that leads to a URL that exceeds these limits. You need to debug your Selenium scripts and find out what causes the problem, not suppress this symptom.

+1
source

, Selenium Server , , Content-Length 798242 , Selenium 8192 . , , - ASP.NET.

:

Response.ClearContent();
string data = GetSomeData();
Response.Write(data);
Response.Flush();
Response.Close();

Content-Length :

Response.AddHeader("Content-Length", data.Length.ToString());

, :

Response.ClearContent();
string data = GetSomeData();
Response.AddHeader("Content-Length", data.Length.ToString());
Response.Write(data);
Response.Flush();
Response.Close();
0

Source: https://habr.com/ru/post/1699666/


All Articles