The Web_custom_request method can send post and get type requests
Web_submit_data can only send a post-type request
All requests sent by the Web_submit_data method can be implemented using Web_custom_request
Web_custom_request can implement requests that web_submit_data cannot implement.
For example, "query all messages and delete" In this case, when the query we use Association to grab all the messages corresponding to the identity of an array, if the use of Web_submit_data to complete the deletion of the request, a number of Web_submit_data requests to complete, but the use of web_ Custom_request can be completed by a request, by writing the code itself to spell the body value of a Web_custom_request method post request.
The data submitted in the Web_submit_data request exists in this way
" name= Property name , " , " value= Property Value "
such as: "Name=locale", "Value=l2″, Enditem,
"Name=datacenter", "Value=yh", Enditem,
"Name=username", "Value=12044″, Enditem,
If we want to commit a property that contains multiple values (which is the case in the example above), it cannot be processed and can only be handled by multiple web_submit_data.
The following is a typical web_submit_data and web_custom_request request, and you can see that the data submitted in Web_custom_request (body) exists in this way
" body= Property name = Property Value & Property name = Property Value & "
Web_submit_data ("Login",
"Action=http://192.168.14.21:78......ndex_sso.jsp",
"Method=post",
"Reccontenttype=text/html",
"Referer=http://192.168.14.21:7888...%3d%2findex_sso.jsp",
"Mode=html",
ItemData,
"Name=locale", "Value=l2″, Enditem,
"Name=datacenter", "Value=yh", Enditem,
"Name=username", "Value=12044″, Enditem,
"Name=password", "value=", Enditem,
"Name=_eventid", "Value=submit", Enditem,
"Name=ispureweb", "Value=true", Enditem,
"Name=solutionname", "Value=eas", Enditem,
"Name=dbtype", "Value=1″, Enditem,
"Name=eassessionid", "VALUE=EAS;YH; l2;12044; Basedb ", Enditem,
"Name=userauthpattern", "Value=basedb", Enditem,
"Name=loginflow", "Value=true", Enditem,
last);
Web_custom_request ("Commonquerydialog.jsf_3″,
"URL=HTTP://192.168.14.21:7888/EA...UERYDIALOG.JSF",
"Method=post",
"Resource=0″,
"Reccontenttype=text/javascript",
"Referer=http://192.168.14.21:7888/... Dailyloanuerc%2bihtml ",
"Mode=html",
"Enctype=application/x-www-form-urlencoded;charset=utf-8″,
"body=querydialog%3aselectsolutionlist=%e6%9f%a5%e8%af%a2&querydialog% 3aj_iduserfilterpanel_3_value=kd5qoaepeadgaaf8wkgedmznrtq%3d&=%e6%b9%96%e5%8d%97%e4%ba%9a%e5%8d%8e%e4%b9% B3%e4%b8%9a%e6%9c%89%e9%99%90%e5%85%ac%e5%8f%b8&querydialog%3aj_iduserfilterpanel_6=&querydialog%3aj_ Iduserfilterpanel_9_value=3&=%e5%a4%a7%e4%ba%8e%e7%ad%89%e4%ba%8e&querydialog%3aj_iduserfilterpanel_11 =0&querydialog%3aj_iduserfilterpanel_14_value=&=&querydialog%3aj_iduserfilterpanel_17_value=&= &querydialog%3aj_iduserfilterpanel_20_value=&=&querydialog%3aj_iduserfilterpanel_23_value=&= &querydialog%3aj_iduserfilterpanel_26_value=&=&querydialog%3aj_iduserfilterpanel_29_value=&= &queryDialog%3Aj_iduserFilterPanel_32=&queryDialog%3Aj_iduserFilterPanel_35_value=&=& querydialog%3aj_iduserfilterpanel_38=2008-08-01&querydialog%3aj_iduserfilterpanel_41=2008-08-28& Querydialog%3afiltergrid_modifieddata=%5b%5d&querydialog%3afiltergrid_removeddata=%5b%5d&querydialog%3a_postback=&querydialog% 3auserfilterpanel=%2fcp%2fbc%2fdailyloanbillcommquery.xhtml&JAVAX.FACES.VIEWSTATE={VS2} ",
last);
Through my observation, I found that there are two cases of post requests that are recorded by LoadRunner as Web_custom_request,
1. Requests for bulk submissions of multiple data with the same attribute name mentioned above
2. Header Property x-requested-by A POST request with a value of XMLHttpRequest
One of the two ways to implement the request is to note that the property value in the body in web_custom_request must be URL-encoded if it contains some special characters, or the Web server will return a 500 error. A typical example is if the body contains special characters such as "=" in Viewstate,viewstate, which must be encoded by URL at this time, and an encoding conversion function is provided in Loadruner.
Web_convert_param ("Vs1″," sourceencoding=html "," Targetencoding=url ", last);
In addition to LoadRunner, you can press Ctrl+e in fiddler to convert
Turn: Differences between Web_custom_request and Web_submit_data in LoadRunner