Selenium RC Result UTF8 Problem

Facebooktwittergoogle_plusredditpinterestlinkedinmail

It's a long existing and fundamental problem: the HTML result after execution of Selenium HTML suite is not properly encoded as utf-8.

A detailed report could be found here:

https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/1212

However, it's never fixed.

While I could understand that the focus is shifted to Selenium 2, it seems unfortunate that the ticket now forbids further contributions from others, even if there is any. It also shows a generic problem when using Github for the issue management. While people raised a question in Stackoverflow, people would come back and update the answers years later, but it's not the case for Github.

Anyway, after some lengthy investigation, it seems to be related to the problem of Java encoding when data is submitted from the browser proxy.

Here is my changeset. It's pretty messy, but it works:

https://github.com/bartsolutions/selenium/commit/56391b47cdef58ea7f2914c02ebba9aaea444c05

The following few lines in SeleniumHTMLRunnerResultsHandler.java should be the most critical part:

To compile, just run

And the binary you needed for selenium RC could be found here:

build/java/server/test/org/openqa/selenium/server-with-tests-standalone.jar

Hope it could help some others in the future.

Leave a comment

Leave a Reply

Your email address will not be published.

*