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:
1 2 3 4 5 6 7 8 9 10 11 12 |
public String toUTF8String(String input){ byte[] bytes = input.getBytes(StandardCharsets.ISO_8859_1); String output = new String(bytes, StandardCharsets.UTF_8); return output; } public void handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse res) throws HttpException, IOException { ... postedLog = this.toUTF8String(postedLog); suite = this.toUTF8String(suite); |
To compile, just run
1 |
./go |
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