loadrunner--Common function Categories: LoadRunner 2012-04-11 20:41 703 people Read reviews (0) Favorites Report loadrunnersearchweb server Script Stringweb_url () and Web_link () Both are page-access functions that implement the Get method in an HTTP request. Web_url ("Name to display in test results", "url= address to be accessed", last), Web_link ("name to display in test results", "text= hyperlink name to be clicked", last); If a page has more than one hyperlink name with the same name , you can use the ORD keyword to select a specific link. The sequence of links of the same name is determined by the order in which the HTML code is interpreted (from left to right, from top to bottom). Web_submit_date () and Web_submit_form () submit data to the specified page. Web_submit_data (); This function does not need the support of the previous page, directly sent to the corresponding page related data. Web_submit_data ("login.pl", "action=http://www.testweb/login.asp", "Method=post", "reccontenttype=text/html", " Referer=http://www.testweb "," mode=html ", ItemData,/* data to be transmitted" Name=username "," VALUE=WEISF ", Enditem," Name=password " , "Value=gggg", Enditem, last); Web_submit_form (); This function automatically detects if a form exists on the page and then transmits the ItemData data behind it. Web_submit_form ("login.pl", ItemData,/* data to be transmitted "Name=username", "VALUE=WEISF", Enditem, "Name=password", "VALUE=GGGG" , Enditem, last); Association function: the Web_reg_save_param () association is to save the contents of the server response back to a parameter. Add an association function: insert-new Step, enter Web_reg_save_param in the query box. The location of the associated function must precede the request. Functions are commonly usedProperties: Search in,left boundary,right boundary,instance,relative Frame id,not found,save length,save offset,ignore Redirections. Search in: You can modify this option if you want to get only the content returned by some servers. Search in a total of 4 options, Header Body noresource all. Noresource: Refers to content only from the resource file, that is, only the content is captured from the HTML file format. Header Body All: These 3 options are associated with everything returned from the request, including images, JS scripts, and so on. Left boundary,right boundary: around the border. Instance: You can fill in any integer or all. Fill in the numbers: remove the corresponding order values from the returned content. Fill in all: Returns the value of all matching filtering policies. Relative frame ID: This option is designed specifically for frame-structured web sites. Not Found: Sets the processing when no matching content is found. The default is error. Save Length: Sets how long the associated content needs to be saved. Save Offset: Sets the associated content offset, starting with the first associated operation. If the left and right edges of the association are dynamic and cannot determine the length of the associated content that is returned, you can use the function strtok () to cut the character content (similar to regular expressions) parameters and set the offset and length, which can be achieved with the function Lr_save_var (). A parameter cannot be compared with a value, it is converted to a string by the lr_eval_string () function, and then converted to an integer by the atoi () function to be compared with the value. Text checkpoint function: Web_reg_find () Vugen determines if the script execution succeeds based on the state returned by the server, and if the server returns an HTTP status of 200K, then Vugen will assume that the script runs through. The checkpoint function is also written before the request. (Usually the registration function is written before the request) the text checkpoint differs from the association in that the checkpoint function can only return the number of times the content was retrieved. Function Common Properties: Search for specific text,search for text by start and end of String,search in,save Count,fail if. Search for Specific text: A standard literal that needs to be queried. Search for text by start and end of string: Left and right boundary. Search in: three options Headers,body,all. Save count: Records the number of occurrences of the find content and saves it in one parameter. Fail if: Set what case text checkpoint function error, there are two options found and NotFound. Transaction-related function transaction response time does not include the client GUI time (such as the time spent by the browser explaining the page) transaction-related functions: Lr_get_transaction_duration ("Transaction name"); Gets the time that the corresponding transaction lasted when the function was run, returning a double type. Lr_get_transaction_wasted_time ("Transaction name"), or//the wasted time when the corresponding transaction reaches the run position of the function, returns a double type. Lr_wasted_time (MS); Add wasted time for a thing, no return. Lr_stop_transaction ("Transaction name"); Pauses a transaction, and the operation after the function is not recorded in the transaction time. Lr_resume_transaction ("Transaction name");//Resume the paused transaction as far as possible do not use the Lr_think_time () function within a transaction; Wasted time: A transaction should be deducted for other reasons caused by the waste. By default, LR takes the time it takes to run its own script in wasted. such as the time of the association, checkpoint function.
loadrunner--Common functions