A comprehensive example of LoadRunner associated Web_custom_request

Source: Internet
Author: User
Tags sprintf

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.