Use LoadRunner 12 to record a login script for a Web page of a project that is currently being developed, and always prompt the following error message when playing back:?
1. Token was wrong, the server encountered an internal error?
2, Error-26612:http status-code=500?
3, Web_custom_request ("login") highest severity level is "ERROR", 2531 body bytes,204 header Btyes?
See 500 error, think of is a code problem, after and development confirmed, the request Token,cookie in the header is no problem. Since I'm not familiar with how tokens, cookies, and so on are handled in scripts, record another login script for the system we're using and compare it to my script. Discovers that the recorded script of the system being used can fetch the cookie value, and automatically adds the Web_add_cookie () function and automatically associates it, and no cookie-related content is found in the system script being developed. So you can determine that the token or cookie that the server responds to is not captured when recording.
Then to see the recording configuration information inadvertently resolved the problem. The method is as follows:?
1. Enter the recording Options > HTTP Properties > Advanced page?
2, hit you recording schemes in the Headers button, enter the headers pop-up page?
3. Select "Record headers not in list", tick "Csrf-token" in the list box below (check the parameters in the request header against your HTTP request header). )?
4. Click OK?
After setting up and re-recording the script, you will find that the new recorded script has more than one function Web_add_header ("X-token", "Specific value"), before playing back the script, select the token value right-click to select "Correlate Selection" to associate, Then the replay was successful.?
Note: If you do not make these settings, you should also add Web_add_header ("X-token", "concrete value") functions directly before the request script after recording, or you can do so. Similar cookie,session can be handled as well.
Reprint: http://blog.sina.com.cn/s/blog_14b788a260102vhcb.html
LoadRunner recording does not get token