LR Paging scripts and implementing business operations on each page

Source: Internet
Author: User

Performance requirements: Delete a record in the list, or operate on each record in the list (such as clicking on the "number" of each record to enter the Order Details page, or "Enable", "stop" for each record in the list)

Example: VUser script to simulate the user in the order list click on each record's "number" to enter the Order Details page to process, the status of the record will change, at this time, if another virtual user into the order list for the same order record to do the same operation, The page will prompt (the record has been processed) causes the subsequent script association to fail, the running scene will also error, then you need to do in the LR script in addition to parameterization and association, but also need to implement the paging script (assuming the list shows 10 records per page), and on each page to do a text checkpoint ("Order number"), An operation that iterates through all the records in the list.

Here is the implementation of the list page in the local environment script, and on each page to do a text check point,

System List Interface,

Implementation code, as follows:

Action2 () {inti; inttemp =1; Charstr[205]; Lr_think_time (6); Web_reg_find ("text=101036",                 "Savecount=modify_count", last); Web_url ("admin_list",         "url=http://localhost:8088/spring-ssh/admin/admin_list",         "resource=0",         "reccontenttype=text/html",         "Referer=http://localhost:8088/spring-ssh/index",         "Snapshot=t3.inf",         "mode=html", Extrares,"url=. /images/navigation.png", Enditem,"url=. /images/index_out.png", Enditem,"url=. /images/search.png", Enditem,"url=. /images/body_bg.png", Enditem,"url=. /images/fee_out.png", Enditem,"url=. /images/role_out.png", Enditem,"url=. /images/bill_out.png", Enditem,"url=. /images/admin_out.png", Enditem,"url=. /images/top_bg.png", Enditem,"url=. /images/account_out.png", Enditem,"url=. /images/information_out.png", Enditem,"url=. /images/password_out.png", Enditem,"url=. /images/btn_bg.png", Enditem,"url=. /images/report_out.png", Enditem,"url=. /images/modification.png", Enditem,"url=. /images/warning.png", Enditem,"url=. /images/service_out.png", Enditem,"url=. /images/delete.png", Enditem,"url=. /images/admin_on.png", Enditem, last); //Total 205 pages, traverse each page     for(i=1; i<=205; i++){        //If a checkpoint is found on this page, exit the loop        if(Atoi (Lr_eval_string ("{Modify_count}")) >0) {lr_output_message ("checkpoint found on page%d", temp);// the            return-1; }Else{            //make text checkpoints on every pageWeb_reg_find ("text=101036",                 "Savecount=modify_count", last); Temp=1+i;//converts the int type to a string type, saved in 10 binaryItoa (TEMP,STR,Ten); Lr_save_string (str,"Next"); //Click the next pageWeb_submit_data ("admin_list",         "Action=http://localhost:8088/spring-ssh/admin/admin_list?page={next}",         "Method=post",         "reccontenttype=text/html",         "referer=http://localhost:8088/spring-ssh/admin/admin_list",         "Snapshot=t4.inf",         "mode=html", ItemData,"Name=privilegeid","value=0", Enditem,"Name=rolename","value=", Enditem, Extrares,"url=. /images/body_bg.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem,"url=. /images/search.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem,"url=. /images/top_bg.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem,"url=. /images/role_out.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem,"url=. /images/index_out.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem,"url=. /images/navigation.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem,"url=. /images/fee_out.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem,"url=. /images/account_out.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem,"url=. /images/admin_out.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem,"url=. /images/bill_out.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem,"url=. /images/service_out.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem,"url=. /images/modification.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem,"url=. /images/delete.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem,"url=. /images/information_out.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem,"url=. /images/report_out.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem,"url=. /images/btn_bg.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem,"url=. /images/warning.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem,"url=. /images/password_out.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem,"url=. /images/admin_on.png","Referer=http://localhost:8088/spring-ssh/admin/admin_list?page={page}", Enditem, last); }            }    return 0;}

LR Paging scripts and implementing business operations on each page

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.