"Go" LoadRunner checkpoint settings

Source: Internet
Author: User
Tags list of attributes

Transferred from: http://www.cnblogs.com/fnng/archive/2013/03/10/2953257.html

Determining if the script is successful is determined by the state returned by the server, and if the HTTP status returned by the server is vugen, then the script is considered to be running correctly and is running. Will the error page code be returned when most systems fail? No general system will return a message prompt to enhance the user's feelings. For example, "website busy, please later". In fact, this time the site has been unable to correctly respond to user requests, but the vugen script is not recognized, will mistakenly believe that the site can also be correctly accessed, resulting in analysis errors. So when a checkpoint function is needed to help verify that the request is sent out, the server's return is not what is expected, and if not, then the server returns to be unable to provide a normal service.

Take loadrunner webtours as an example:

1, between recording needs to open the menu vuser---> run-time setting , select the Preferences option, tick the "Enable Image and text check" option. If this option is not checked, the function will not be executed.

2, the following record access to the first page, switch to the Tree view, select the first side "Welcome to theWeb Tours site."

Of course, you can set any content that is marked (the validation request is correct).

3. Pop up the find Text window.

Search for specific Text : The standard text that needs to be queried is very similar to the Find feature in Word.

Search Text by Start and end of string : The text checkpoint function also provides the ability to find from the left handy, and the options refer to the previous section of the correlation function.

Search in : Sets which part of the data returned by the server is queried.

Save Count : This is a special feature of text checkpoints, which will record the number of occurrences of the lookup and store it in a parameter, where you can fill in a parameter name to hold the count result

Fail If : Set Under what circumstances the text checkpoint function error, provides two options:Found,NotFound . Found that is , if there are objects that need to be checked in the return of the server, the text checkpoint function is faulted and the NotFound is selected instead, the text checkpoint function is faulted if no corresponding content is found.

Errors in the CHECKPOINT function can result in the entire script running, which makes it easy to locate logic errors in the script's run.

4.Add the checkpoint script as follows:

Action () {Web_reg_find ("Search=body","Text=welcome to the Web Tours site.", last); Web_url ("Webtours","url=http://127.0.0.1:2080/webtours/","Resource=0","Reccontenttype=text/html","Referer=","Snapshot=t1.inf", "mode=html"  "favicon.ico "  url=http:// 127.0.0.1:2080/favicon.ico " "resource=1" ,  "referer=" return 0    

Web_reg_find function

Through the LR11 (F1 key Open) Help document, search web_find function, hint:web_find has been deprecated, recommend the use of web_reg_find function.

int web_reg_find (const char *attribute_list, last);

Web_reg_find ("Search=body",     // definition Lookup range          "savecount=ddd"   // define Lookup count variable name          "TEXT=AAA"         //

Picture Lookup function

You can check the picture on the page by using the Web_inage_check function.

int Web_image_check (const char *checkname, <list of Attributes>, < "Alt=alt" | | "Src=src", last);

Web_reg_find ("Go2venus",     // function title           "Alt=venus"   // picture description               

"Go" LoadRunner checkpoint settings

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.