Small and medium knowledge points of jmeter: variable nesting, MD5, date, url encoding

1. Variable nesting:
It should be noted that currently variables do not support nesting; for example, ${Var${N}} does not work properly. But in JMeter 2.2 and later versions, you can use the function __V (variable) to achieve the purpose of nesting variables (such as ${__V(variable name)}). ${__BeanShell(vars.get("Var${N}")} can be used in earlier JMeter versions.


2. MD5 function: ${__MD5(testString,md5Result)}

3. Date function
Note : ${__time( hhmmss-MMdd,)} is JMeter's own function, used to return the current time of the system, hhmmss-MMdd indicates the format of the time display, uppercase HH is 24-hour system

4.url encoding function:
only Chinese special characters are encoded, Like the English string command, it will not be encoded. Even if the ulrencode function is called, the encoded content is the same as the original text.
Note : jmeter will automatically perform url encoding. For example, the Chinese parameter value, the content seen in the sent request is similar to : %E5%BD%A6, so this function is basically not used.

URL encoding follows the following rules:
Each pair of name/value is separated by the &; character; each pair of name/value from the form is separated by the = character. If the user does not enter a value for the name, then the name still appears, but with no value. Any special characters (that is, those that are not simple seven-bit ASCII, such as Chinese characters) will be encoded in hexadecimal as percent signs, including of course special characters like =, &;, and %. In fact, the url encoding is the hexadecimal of a character ascii code. However, there is a slight change, you need to add "%" in front. For example, "\", its ascii code is 92, and the hexadecimal of 92 is 5c, so the url encoding of "\" is %5c. So what about the url encoding of Chinese characters? Very simple, look at the example: the ascii code of "Hu" is -17670, the hexadecimal is BAFA, and the url code is "%BA%FA".

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326919191&siteId=291194637
Recommended