performancepostutf-8requestjmeter

Simulate accented UTF8 characters in HTTP POST request


I'm using Apache JMeter 2.8 to carry out some performance testing on one web-based information system.

There are several accented letters used in different requests - like 'ä', 'ö', 'ü' or 'õ'.

When it comes to running test scripts and executing requests, for example 'ä' value in some parameter turns into 'ä'. ('ä' - This is the way jmeter saves such character into a *.jmx file) Content encoding for these http requests is set to UTF-8. When i look at the contents of the project, all characters are displayed correcly. When i run test scripts wrong values are used.

Added later: I can successfully simulate GET requests with utf8 chars, but still accented characters in my POST requests look like 'ä'. What can be the reason, why jmeter's GET requests' data has proper utf8 encoding and POSTs Windows-1252/ISO-8859-1/cp1252/"ANSI" instead?

Any ideas why this happens? Thanks in advance!


Solution

  • JMeter saves character correctly in JMX, ensure that you opened them with the right encoding (UTF-8).

    In JMeter there is this property:

    which you can change if this is not the default encoding. But I am not sure it's the issue you are facing.

    Check the "Encode?"

    Solution is:

    if this does not work, it reveals an issue on tested application:

    request.setCharacterEncoding("UTF-8") must be called before using parameters if it's a Java Application.
    

    Same concepts exist for PHP and ASP.