LoadRunner skill checkpoint

Source: Internet
Author: User
Tags list of attributes

 

Whether the script is successfully executed depends on the status returned by the server.HTTPStatus:200 OK, ThenVugenThe script runs correctly and passes. When most system errors occur, will the error page code be returned? Generally, the system returns a message prompt box to improve user experience. For example, "the website is busy. Please wait ". In fact, the website cannot correctly respond to user requests at this time,VugenThe script cannot be identified, and the website may be incorrectly accessed, resulting in an analysis error. Therefore, you need a function to check whether the returned content of the server is expected after the request is sent. If not, the server cannot provide normal services.

 

ToLoadRunnerBuilt-inWebtoursFor example:

1,You need to open the menu between recordingVuser ---> Run-Time Setting, SelectPreferencesSelectEnable image and text check"Option. If this option is not selected, the search function is not executed.

 

 

2,Access the home page, and switchTreeView, select"Welcome to the Web tours site."

Of course, you can set anything that is symbolic (the verification request is correct.

 

3, Pop-upFind textWindow.

Search for specific text : The standard text to be queriedWordThe search function in is very similar.

Search Text By start and end of string: The text check point function also provides the left-side convenient search function. For more information about the options, see the related functions in the previous section.

Search in : Set the part of data returned by the server for query.

Save count: This is a special function of text check points. It records the appearance times of the content to be searched and stores it in a parameter. Here, you can enter a parameter name to store the counting result.

Fail if: Set when the text check point function is incorrect. Two options are provided:Found,Notfound.FoundThat is to say, if an object needs to be checked exists in the server response, the text check point function fails. SelectNotfoundOn the contrary, if the corresponding content is not found, the text check point function fails.

Checking the node function errors will result in the failure of the entire script running result. This function can be used to conveniently locate the logic errors in the script running.

 

4Add 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  "  , Last); web_url (  "  Favicon. ICO  "  ,  "  Url = http: // 127.0.0.1: 2080/favicon. ICO  "  ,  "  Resource = 1  "  ,  " Referer =  "  , Last );  Return   0  ;} 

 

 

Web_reg_findFunction

PassLr11Of (F1Key) Help document, searchWeb_findFunction, prompt:Web_findIt has been deprecated and is recommended.Web_reg_findFunction.

Int web_reg_find (const char * attribute_list, last );

Web_reg_find ("Search = body ",//Define search range"Savecount = DDD"//Define the name of the search count variable"Text = aaa"//Define search contentLast );

 

 

Image Search function

PassWeb_inage_checkThe function can check the images on the page.

Int web_image_check (const char * checkname, <list of attributes>, <"alt = Alt" | "src = SRC">, last );

Web_reg_find ("go2venus ",//Function title"ALT = Venus"//Image DescriptionLast );

 

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.