How does LoadRunner set parameterization uniqueness in the registration business script?

Source: Internet
Author: User

When LR was recording a website registration script, it suddenly encountered a problem: during registration, the registered user needs to verify the uniqueness, so when LR played back the script, you can use the run-time Viewer tool to play back and find that (several breakpoints are set in the script first) the registered script user that actually runs is not successfully registered,

How can this problem be solved?

Of course, I first thought of the script parameterization settings, so I wrote a piece of code, run the script to let it randomly generate a user name (User Name specified format), and then write a dat file, import the DAT file in the parameter settings. The Code is as follows:

/* Author: luihengk */INT I, j, k; char C [250]; char * filename = "C: \ scripts \ test. dat "; long file; If (file = fopen (filename," A + ") = NULL) {lr_output_message (" uncreate a file % s ", filename ); return-1;} web_set_max_html_param_len ("1024000"); for (I = 0; I <= 10; I ++) {k = rand () * 10; sprintf (C, "% d", k); // int to Char strcat (C, "[email protected]"); // append [email protected] to C fprintf (file, "% s \ n", c);} fclose (File );

Import parameter list:

Note: Select next row is set to unique, and update value on is set to each iteration. Here, some data must be kept in the parameterized list. I have set 100 records here.

Set parameterization in the script:

After the preceding settings are complete, you can play back the script again to avoid registration failure. Although no error is reported in the replay log, run-time viewer is used to confirm the error.

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.