When testing a Web program with LoadRunner, you always run into Ajax or ActiveX implementations, which typically contain many client functions (typically JavaScript). How do we deal with it? If you consider this problem from the perspective of functional implementation, you will go into a dead end because LoadRunner is powerless for JavaScript. If we start from the nature of LoadRunner, then the problem will be solved. Because LoadRunner is a protocol-based test, no matter how much Ajax or ActiveX does on the client, as long as it finally sends the request through the HTTP protocol, we can simulate the request to complete the test. Next analyze how to deal with this kind of problem, take the electronic medical record BS version of Doctor's order input as an example (the medical advice input part uses ActiveX technology and AJAX Technology).
1, record the script, analyze the script.
2, Debug script. the script was found to be replayed successfully, but the data was not submitted. At this point we need to see what the HTTP request looks like when recording.
3, modify the script. we need to add web_add_header ("X-ajaxpro-method", "Saveorder")in the script before the web_custom_request () function; When we replay it again, the data can be written.
In fact, when we use LoadRunner to test, we should consider the problem from the point of view of protocol, not the programming angle.
LoadRunner Study Notes--ajax