A comprehensive example of LoadRunner associated Web_custom_request
loadrunner Associated Web_custom_request, a comprehensive example of a ticket system that comes with I believe read this article everyone to learn LoadRunner script will be very helpful. The problem to be solved in this example: (1) The dynamic deletion of an order from the LoadRunner booking system, (2) The Dynamic Judgment Form order entry, the execution of the cancellation of the first Order; (3) LoadRunner Association web_custom_request and the application of loop statements. Lack of code: variable definition too much, I hope to share with you. Here is the source code for my script:------------------------------------------------------#include "web_api.h" Action () {int i, K;char form[1024];char temp[1024];char tmp[1024];char tp[1024];char tp1[1024];char tp2[1024]; web_url ("mercurywebtours", "URL=http://192.168.8.9/ mercurywebtours/", " resource=0 ", " RecContentType= Text/html ", " referer= ", " Snapshot=t1.inf ", "mode=html", last); lr_think_time; web_ Submit_form ("login.pl", "Snapshot=t2.inf",itemdata, "Name=username", "value=zhangming", enditem, "Name=password", "value=666666", enditem, "name=login.x", "value=50",enditem, "NAME=LOGIN.Y", "Value= One ", enditem, last); lr_think_time (4); web_reg_save_param (" Flightid ", " lb=input type=\ "hidden\" name=\ "flightID\" VALUE=\ "", "rb=\" ", " Ord=all ", " search= Body ", last); web_image (" Itinerary button ", "Alt=itinerary button", "Snapshot=t3.inf", last); strcpy (Form, "Body=1=on"); I=atoi (Lr_eval_string ("{flightID_count}")); for (k=1;k<=i;k++) {sprintf (temp, "{flightid_%d}", k); strcpy (tmp,lr_eval_string (temp));//Remove the value of Flightid, and pass the value to TMPSPRINTF (TP, "&flightid=%s ", TMP); strcat (FORM,TP);} for (k=1;k<=i;k++) {sprintf (TP2, "&.cgifields=%d", k); strcat (TP1,TP2); }strcat (FORM,TP1); Strcat ( form, "&removeflights.x=137&removeflights.y=13"); Lr_output_message ("form value is =%s", form); web_custom_ Request ("itinerary.pl", "url=http://192.168.8.9/mercurywebtours/itinerary.pl", "Method=post", "Reccontenttype=text/xml", form, "Snapshot=t7.inf", last); return 0;}
A comprehensive example of LoadRunner associated Web_custom_request