Decoding Html entites in Jmeter/ unescapeHtml function in Jmeter: Jmeter is one of the most popular open-source load testing tools. Jmeter itself has some of the built-in functions which we need regularly while creating scripting. one of the useful functions is __unescapeHtml which will be used to decode the HTML entities.
- unescapeHtml
- timeshift
- Base encoding
- Generating time in different formats
- Url encode
- Url decode
- Random String
- Random Number
- UUID
- Random Date
- File to string
- CSV Reader
when do we need to use unescapeHtml function?
For some of the applications, developers will return the document or some part of the document in HTML entities format. As per their requirement while developing the application.
If data which need to send it to the server again in further requests which are in Html encode format. Then we need to capture value using Extractors in Jmeter and make use of UnesapeHtml function in Jmeter.
How to identify data is returned in the Html encoding format?
If the data which you received from the server is containing &# symbols beside each other and ends with a semicolon (:). Then we need to consider the data is Html encoded, Every time & symbol will be in first place beside & symbol you will be seeing # Symbol and ending with a semicolon ; Symbol.
How to use unescapeHtml in Jmeter?
- Open Jmeter
- Go to Function Helper Dialog
- Scroll till you see __unescapeHtml function like below
- Then paste the Html encoded string in String to unescape editor like below
- After clicking on the Generate button it will generate the decoded string like below
How to use the Jmeter variable in UnescapeHtml function?
you can use JMeter variable in Jmeter functions directly like below
${__unescapeHtml(${variablename})}$variableName is variable correlated or User-defined values in Jmeter
Thanks
Also Read: Beanshell Assertion in Jmeter
Html decoding in Jmeter/ unescapeHtml in Jmeter
Thanks much. I wasted 6 hrs before I landed here. This made my day
thanks :-)