The company required the testing tools to be unified from JMeter to Hyperpacer. 650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f09.gif "alt=" I_f09.gif "/>650" this.width=650; "src=" Http://img.baidu.com/hi/face/i_f09.gif "alt=" I_f09.gif "/>
Today, when testing with hyperpacer, the console suddenly pops up with a lot of "500" errors.
We all know that the HTTP status code in the beginning of 5 is generally the client's problem, because it is the new from JMeter to hyperpacer up, so the first reaction: is not the problem of the tool itself ah???
Repeated execution several times, the discovery is in the same request place only then appears "500", is the concurrency question? Modify the number of concurrent users, change to a single user, found that the problem remains.
Look at this request for the problem,
650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M01/7F/3A/wKioL1cXQNKSukNDAAMJl1o5P8E575.jpg "title=" 1.jpg " alt= "Wkiol1cxqnksukndaamjl1o5p8e575.jpg"/>
Very simple JSON data, not see what the problem. Client can not see the problem, then look at the server log information, sure enough to see thrown an exception
650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M01/7F/3A/wKioL1cXQhvBR4NAAAJE5-Rul84131.jpg "title=" 2.jpg " alt= "Wkiol1cxqhvbr4naaaje5-rul84131.jpg"/>
Exception prompt information is obvious, in the first line of the character at the No. 300 there is an illegal escape, back to the client, you can see the main data of the post has "text": "Full path information: 11 changes in cost \1160 out a single handling fee \11600010 a single handling fee" such a line. We know that "\" will be used as an escaped identity, that is, the "\" character is considered to be the following character to be escaped, such as our example here is the "\1" to escape processing, "\1" did not see this escape, it should be a meaningless escape, so reported illegal escape.
If you do need to use "\", you need to use "\ \" To escape will be recognized as "\", then the solution is simple, each "\" preceded by a "\" to escape.
However, do you think you think that is what you think? no~~~~
After the escape, the execution again, found still here, error message is still illegal escape. What's the reason for this?
Think for a long time to think not quite understand, later speculation may be hyperpacer itself to the request body parsing needs to be escaped once, and JSON in the passing of data also requires to escape the word Mr. Foo to escape in value, so that is to be escaped and then escaped, that is, a "\ "Escape and re-escape words are" \\\\ ", 650) this.width=650;" src= "Http://img.baidu.com/hi/face/i_f08.gif" alt= "I_f08.gif"/>650 " this.width=650, "src=" Http://img.baidu.com/hi/face/i_f31.gif "alt=" I_f31.gif "/> So modified, sure enough, no longer reported 500.
Although the problem is solved, but still leave a small doubt, if really guessed: the tool itself on the request parsing is also need to escape, then intercept the request and generated when the tool should be the first to escape the processing ah, always feel that there are some contradictions in the place.
Leave a small tail, and then analyze it in detail later.
The problem is always solved, finally, to make a small memo, generally often need to use "\" to escape the characters as follows 8:
\b Backspace
\f Page Change
\ nthe line break
\ r Enter
\ t Horizontal Tabulation
\ \ counter Slash
\ ' Single quotation mark
\ "Double quotation marks
This article is from the Performance test blog, so be sure to keep this source http://1152313.blog.51cto.com/1142313/1765907
A "\" murder--a "500" error in Hyperpacer playback