String Functions Present in Loadrunner

String Functions

Below are the most important list of string functions present in loadrunner.

lr_eval_string :

  • lr_eval_string function returns the input string after evaluating any embedded parameters.
  • So if the string argument contains only a parameter, the function returns the current value of the parameter.
  • Example : lr_save_int(47, "searchCount");

lr_save_string :

  • lr_save_string function assigns the specified null-terminated string to a parameter.
  • But the functions is useful in correlating queries.
  • Example : lr.save_string("John Doe" , "Student" );

lr_save_var :

  • lr_save_var function assigns the specified variable length string to a parameter.
  • So the function is useful in Correlating Statements.
  • But to determine the value of the parameter, use the lr_eval_string function.
  • Do not:
    • save an input buffer that contains null or other binary data.
    • pass a value_len longer than the actual data.
  • Example : lr_save_var( lr_eval_string("{InName}"),  MAX_NAME_LEN, 0, "ShortName");  // Save the first four characters of "InName" to "ShortName"

lr_save_datetime :

  • lr_save_datetime function saves the current date and time, or the date and time with the specified offset into a parameter.
  • So resulting string will be truncated once it reaches MAX_DATETIME_LEN characters.
  • Example : lr_save_datetime("Tomorrow is %B %d %Y", DATE_NOW + ONE_DAY, "next");

lr _advance_param :

  • lr_advance_param function causes the script to use the next available value of the parameter.
  • But if you are running multiple iterations, you can specify in the parameter properties to advance automatically to the next value for each iteration.
  • So use this function within an iteration to advance to the next value.
  • Therefore the function is not recorded—you insert it manually into your script.
  • Example : lr_advance_param("Param1");

lr _decrypt :

  • lr_decrypt function unmasks an encoded string. This function is generated during recording to encode passwords.
  • VuGen records the actual password but displays an encoded version of the password within the lr_decrypt function.
  • Example :  txtPassword = lr.decrypt("38620da61ca1093e7aa7ec");

lr_eval_string_ext :

  • lr_eval_string_ext function evaluates in_str by replacing parameters with their string value.
  • It creates a buffer containing the expanded string and sets out_str to point to that buffer.
  • But also assigns the length of the buffer to out_len. Use this function in conjunction with lr_eval_string_ext_free in preference to lr_eval_string when evaluating strings in a loop.
  • Using lr_eval_string in a loop uses more memory.
  • Example : lr_eval_string_ext ("{Param1}", 8, &newParam,  &prmLen, 0, 0,-1);

lr_eval_string_ext_free :

  • lr_eval_string_ext_free function frees the memory allocated by lr_eval_string_ext.
  • Example : lr_eval_string_ext ("{Param1}", 8, &newParam, &prmLen, 0, 0,-1);

lr_save_searched_string :

  • lr_save_searched_string function searches for string search_string inside string or character array buffer, and finds the nth occurrence of search_string, where n is occurrence plus 1.
  • So the sub-string to be saved starts at offset after the end of the nth occurrence of search_string, and has length string_len.
  • Example : lr_save_searched_string(data_1, olen, 0, "SCertRep", 9, 16, "cert1");

Click Here to see all the message function present in loadrunner.

Transaction Functions in Loadrunner

Transaction Functions

There are different category of loadrunner functions available in Vugen. Below are the most important loadrunner functions used.

lr_end_sub_transaction :

  • lr_end_sub_transaction function marks the end of a sub-transaction.
  • Insert these functions immediately before and after the sub-transaction steps.

lr_end_transaction :

  • lr_end_transaction function marks the end of a transaction and records the amount of time it took to perform the transaction.
  • It has LR_Fail, LR_Pass, LR_stop and LR_Auto Status.
  • So,you can manually set the status of the transaction according to your need.

lr_end_transaction_instance :

  • lr_end_transaction_instance function marks the end of a transaction instance and records the amount of time it took to perform the transaction.
  • It has LR_Fail, LR_Pass, LR_stop and LR_Auto Status.
  • So, you can manually set the status of the transaction according to your need.

lr_fail_trans_with_error :

  • lr_fail_trans_with_error function sets the default exit status to LR_FAIL for all open transactions with LR_AUTO in their lr_end_transaction statement and sends an error message.
  • The message is sent to the output window or log file.
  • It has LR_Fail, LR_Pass, LR_stop and LR_Auto Status.
  • You can manually set the status of the transaction according to your need.

lr_get_trans_instance_duration :

  • lr_get_trans_instance_duration function returns the duration of an open transaction instance in seconds until this point.
  • It was used to determine the total transaction time before the transaction has ended.
  • lr_get_trans_instance_duration returns values greater than zero only for open transactions.

lr_get_trans_instance_wasted_time :

  • lr_get_trans_instance_wasted_time function returns the Wasted Time of the specified transaction until this point.
  • lr_get_trans_instance_think_time function returns values greater than zero only for open transactions.

lr_get_transaction_duration :

  • lr_get_transaction_duration function returns the duration in seconds of the specified transaction to this point.
  • It will returns the duration including Wasted Time.

lr_get_transaction_think_time :

  • lr_get_transaction_think_time function returns the think time of the specified transaction until this point.
  • It returns values greater than zero only for open transactions.

lr_get_transaction_wasted_time :

  • lr_get_transaction_think_time function returns the think time of the specified transaction until this point.
  • It returns values greater than zero only for open transactions.

lr_resume_transaction :

  • lr_resume_transaction function resumes the reporting of transaction data within the script that was suspended by lr_stop_transaction.

lr_resume_transaction_instance :

  • lr_resume_transaction_instance function resumes the reporting of transaction data within the script that was suspended by lr_stop_transaction_instance.
  • If lr_resume_transaction_instance is not called, the final results reflect the statistics only until the call to lr_stop_transaction_instance.

lr_set_transaction_instance_status :

  • lr_set_transaction_instance_status function sets the status of the open transaction with the transaction handle trans_handle.
  • The handle was returned by lr_start_transaction_instance.

lr_set_transaction_status :

  • lr_set_transaction function creates a transaction, its duration, and status in a single call.
  • Use it where the business process you want to capture in a transaction does not consist of sequential steps, or where you may or may not want to create a transaction, depending on conditions that are known only during the test.

lr_set_transaction.

  • lr_set_transaction can also be used to report the duration of a failed transaction by saving the duration before the transaction fails with lr_get_transaction_duration then using lr_set_transaction to create a new transaction for reporting that time.
  • It creates and closes the transaction.

lr_set_transaction_status_by_name :

  • lr_set_transaction_status_by_name function sets the default status of the open transaction with name trans_name.
  • Transaction's lr_end_transaction statement must use automatic status assignment by passing LR_AUTO as its status parameter.
  • Transaction's status is defined in the status parameter of lr_end_transaction.

lr_start_sub_transaction :

  • lr_start_sub_transaction function marks the beginning of a sub-transaction.
  • Sub-transactions are used for isolating parts of a business process.
  • Multiple sub-transactions can be nested within a parent transaction.
  • A sub-transaction may also be a parent to a smaller sub–transaction.

lr_start_transaction :

  • lr_start_transaction function marks the beginning of a transaction.
  • Transactions can be nested, but each lr_start_transaction statement must be associated with an lr_end_transaction statement or it will be interpreted as an illegal command.

lr_start_transaction_instance :

  • lr_start_transaction_instance function marks the beginning of a transaction instance. A
  • Transaction instance is an occurrence of a transaction with transaction_name.
  • Instances are identified by their handle which distinguishes them from other instances of the same transaction.
  • So the function returns the handle of the transaction instance which identifies the instance.

lr_stop_transaction :

  • lr_stop_transaction, statistics returned by the "get" Transaction Functions reflect only the data up to the call, until lr_resume_transaction is called.
  • The specified transaction must have been opened with lr_start_transaction.
  •  lr_resume_transaction is not called, the "get" functions and the final results reflect only the duration from the transaction start to the lr_stop_transaction call.
  • Thus, lr_stop_transaction and lr_resume_transaction can be used conditionally to collect information either about an entire transaction, or only the beginning.
  • To accomplish this, call lr_resume_transaction only if your condition is met.

lr_stop_transaction_instance :

  • lr_stop_transaction_instance, statistics returned by the "get" Transaction Functions reflect only the data up to the call, until lr_resume_transaction_instance is called.
  • The specified transaction instance must have been opened with lr_start_transaction_instance.
  • If lr_resume_transaction_instance is not called, the final results reflect the statistics only until the call to lr_stop_transaction_instance.
  • Therefore, lr_stop_transaction_instance and lr_resume_transaction_instance can be used to conditionally collect information about either the beginning, or all of the transaction.

lr_wasted_time :

  • lr_wasted_time allows you to subtract the time wasted on incidental or secondary actions from all open transactions.

Click Here to see all the run time function present in loadrunner.

web_reg_save_param_ex

web_reg_save_param_ex

web_reg_save_param function is deprecated from 12.5 version of Loadrunner. Therefore web_reg_save_param_ex and web_reg_save_param_xpath is introduced. Here we will see about web_reg_save_param_ex function and its attributes.

 Syntax :

web_reg_save_param_ex("ParamName=<output parameter name>", [LB[/IC][BIN]=<value>, ][RB[/IC][BIN]=<value>, ] <List of Attributes>, <SEARCH FILTERS>,LAST );

Example : 

web_reg_save_parama_ex

Most important list of attributes present in the function.

ParamName:

  • It store the dynamic values in the specified variable which is found using the attribute.

LB:

  • Left boundary of the dynamic value which we need to capture.
  • If the LB is empty, then it will capture all the characters from the starting of the boundary.
  • It is case sensitive, therefore when you are specific the boundary make sure they are exactly same as it is displayed.
  • One can further customize the search text, by using one or more text flags.
  • Its the most important attribute is mandatory.

RB:

  • Right boundary of the dynamic value which we need to capture.
  • If the RB is empty, then it will capture all the characters from the starting of the boundary.
  • It is case sensitive, therefore when you are specific the boundary make sure they are exactly same as it is displayed.
  • One can further customize the search text, by using one or more text flags.
  • Its the most important attribute is mandatory.

List of Attributes :

Most important attributes used in this section.

  • ORD:
    • It will Indicates the ordinal position of the dynamic value or instance of the match of the value.
    • If you specify as "All," it saves the parameter values in an array.
    • Default value of the instance is 1.
    • This attribute is optional.
  • NOTFOUND :
    • It used to handle when the boundary is empty string in the response.
    • "Not found=error" is the the default value. It will raise the error when a boundary is not found.
    • "Not found=warning" does not raise an error. Therefore "warning" option is ideal if you want to see if the string was found and you do not want the script to fail.
    • This attribute is optional as well.
  • SaveLen :
    • Length of the sub-string where the value is found, from the specified offset, to save into parameter.
    • Default value is -1, indicating to save to the end of the string.
    • This attribute is optional.
  • SaveOffset:
    • Offset of a sub-string where the value is found, to save into parameter.
    • Value must be non-negative.
    • Default value is 0.
    • This attribute is optional.

SEARCH_FILTERS :

Search Filters starts with the marker that is SEARCH_FILTERS. The SEARCH_FILTERS section is option, therefore we can use this when it is required only. Below are the most important specifiers used in this section.

  • ContentType:
    • Only responses with the specified ContentType header are searched.
    • Therefore this will search only the header section of the response.
    • The ContentType can contain the * wildcard.
  • HeaderNames:
    • We can give a list  of HTTP response header names with comma-separated.
    • Therefore only the specified headers' values are searched in the response.
    • It will be applied only when the Scope is "Headers".
    • If no Ordinal value is specified, the first occurrence of a match of the LB and RB is found.
  • Ignore Redirections:
    • If you set the attribute "Ignore Redirections=Yes", then if the server response contains any redirection information like (HTTP status code 300-303, 307). The response is not searched. Instead, once the redirection response is received, the GET request is sent to the redirected location. And the search is performed.
    • Therefore the default value is "Ignore Redirections=No".
    • This attribute is optional.
  • RelFrameID :
    • It specific the hierarchy level of the HTML page which is related to the requested URL.
    • Default value is ALL.
    • This attribute is optional.
  • RequestURL:
    • Only responses to this request are searched.
    • The URL can contain the * wildcard.
    • Therefore you can specif any wildcard in this section.
  • Scope:
    • Most important section is to specific where you need to search for the delimited data.
    • The possible values are:
      • All- Search the entire buffer.
      • Headers - Search only the headers.
      • Body - Search only body data.
      • Cookies - Search only in cookies.
    • This attribute is Optional.

Difference between parameterization and correlation?

Difference between parameterization and correlation

Parametrization :

  • Parameter is a container which is used to hold the values that are used in Vugen script.
  • Parameterization is used to send the different values(Unique values) to the Vugen script  from the parameter file.
  • It will help a single virtual vuser to use different data on each run.
  • Most important part that it is used to simulates real-life usage of an application as it avoids server from caching results.
  • There are different type parameter present in loadrunner.
  • Parameter will hold the value which is saved in the parameter files.
  • Main difference about parameter is that the values will be already present in the file even before the start of the script.
  • Therefore scripts will not fail because of not finding the values.

Click Here to read more about parametrization and its most important  attributes.

Correlation :

  • Correlation is a mechanism of handling the dynamic values passed from the server to the script.
  • It is important aspect which will let the script run end to end without any error.
  • There are two type of correlation which we can use in load runner.
  • Correlation value is captured from the response of the request and then the correlation value will passed to next request.
  • Therefore the script will run without any issues.
  • Dynamic values need to be handled in the script which will done using correlation.
  • Correlation values are captured during the script execution.
  • Therefore there is high chance that if the boundary are empty during the reply of the script. Then script might fail due to the error message.

Click Here to read more about correlation and its most important attributes.

web_reg_save_param Example

web_reg_save_param Example

Some of the examples which will cover the important attributes present in web_reg_save_param function.

Click Here to know about attributes of web_reg_save_param function.

Example 1:

<tr bgcolor=#66CCff><td align=center><input type = radio name=outboundFlight value=230;378;11/20/2003 checked >Blue Sky Air 230<td align=center>8am
<td align=center

  • We will see how we can capture the flight name which is highlighted in red color.
  • It will capture the values Blue Skg Air 230 in the C_Fightname parameter.
  • Ordinal is 1, which means the first occurrence of the value will be captured. Here the value Blue Skg Air 230 is the occurrence of the boundary.

web_reg_save_param("C_Fightname", "LB=checked >", "RB=<td align=center>", "ORD=1", LAST) ;

Example 2:

<tr bgcolor=#66CCff><td align=center><input type = radio name=outboundFlight value=230;378;11/20/2003 checked >Blue Sky Air 230<td align=center>8am
<td align=center

  • In this example, we will see how to use the Not Found and search attribute.
  • "Not Found = Warning" is specified in this example. Therefore when the response of the boundary is empty then the script will display warning but the script will stopped. But when you give as error then script will fail when the boundary values are empty.
  • Search is set "ALL" which means it will search every part of the response.

web_reg_save_param("C_Filghttime", "LB=name=outboundFlight value=", "RB=checked >", "ORD=1","NOTFOUND=Warning", "Search=ALL", LAST) ;

Example 3 :

  • In this example we will see how to use saveoffset, savelen and relframeid.
  • Savelen will save the length of the value.
  • Saveoffset will start the word as specific in the boundary.
  • Relframeid will let the boundary to search the frame where value might be found.

web_reg_save_param("C_Filghttime", "LB=name=outboundFlight value=", "RB=checked >", "SaveOffset=1", "SaveLen=1", LAST) ;

web_reg_save_param

web_reg_save_param

web_reg_save_param is the most important function used in load runner. It is used to capture the dynamic values sent by the server in the application and pass to the next request.

Syntax :

web_reg_save_param("Parameter_name", "LB=Left boundary", "RB=Right boundary", LAST);

These are the most important attributes of web_reg_save_param function which is used.

web_reg_save_param

Below are the list of all the attributes present in the function.

Parameter Name:

  • It store the dynamic values in the specified variable which is found using the attribute.

LB:

  • Left boundary of the dynamic value which we need to capture.
  • If the LB is empty, then it will capture all the characters from the starting of the boundary.
  • It is case sensitive, therefore when you are specific the boundary make sure they are exactly same as it is displayed.
  • One can further customize the search text, by using one or more text flags.
  • Its the most important attribute is mandatory.

RB:

  • Right boundary of the dynamic value which we need to capture.
  • If the RB is empty, then it will capture all the characters from the starting of the boundary.
  • It is case sensitive, therefore when you are specific the boundary make sure they are exactly same as it is displayed.
  • One can further customize the search text, by using one or more text flags.
  • Its the most important attribute is mandatory.

ORD:

  • It will Indicates the ordinal position of the dynamic value or instance of the match of the value.
  • If you specify as "All," it saves the parameter values in an array.
  • Default value of the instance is 1.
  • This attribute is optional.

Search:

  • It specify where to search for the delimited value in the response.
  • It has different values such as.
    • Headers (Search only the headers).
    • Body (search only body data, not headers).
    • No resource (search only the HTML body, excluding all headers and resources).
    • ALL (search body, headers, and resources).
  • Importantly the default value is ALL.
  • This attribute is optional but generally preferred.

NOTFOUND :

  • It used to handle when the boundary is empty string in the response.
  • "Not found=error" is the the default value. It will raise the error when a boundary is not found.
  • "Not found=warning" does not raise an error. Therefore "warning" option is ideal if you want to see if the string was found and you do not want the script to fail.
  • This attribute is optional as well.

RelFrameID :

  • It specific the hierarchy level of the HTML page which is related to the requested URL.
  • Default value is ALL.
  • This attribute is optional.

SaveLen :

  • Length of the sub-string where the value is found, from the specified offset, to save into parameter.
  • Default value is -1, indicating to save to the end of the string.
  • This attribute is optional.

SaveOffset:

  • Offset of a sub-string where the value is found, to save into parameter.
  • Value must be non-negative.
  • Default value is 0.
  • This attribute is optional.

Ignore Redirections:

  • If you set the attribute "Ignore Redirections=Yes", then if the server response contains any redirection information like (HTTP status code 300-303, 307). The response is not searched. Instead, once the redirection response is received, the GET request is sent to the redirected location. And the search is performed.
  • Therefore the default value is "Ignore Redirections=No".
  • This attribute is optional.

Correlation in Load Runner

What is Correlation?

Correlation is a mechanism of handling the dynamic values passed from the server to the script. Correlation is important aspect which will let the script run end to end without any error.

Why we should handle the correlation in the script?

Lets take a example of session id generation.

Recording :

  • While Recording an application, the vugen will sends a request to the application server to start a new session.
  • Server receives the request from the Vugen and assign a new session ID ABCDF.
  • Vugen will stores the session id ABCDF in the script.
  • Start the session with ID ABCDF and send a request to a application server to allow the Vugen to record the flow.
  • Therefore Application server recognizes the ID ABCDF and allows the Vugen to record the script.

Reply :

  • While Replaying the record script, the Vugen script will sends a request to the server to start a new session.
  • Application server will receives the request, and start the new session ID XYZ.
  • But while recording the Vugen would have stored the session id as ABCDF and now the server is expecting the new session if XYZ.
  • Therefore the application server will reject the request to reply script with the old session.

Solution :

  • Capture the session id into a variable which is generated from the application server at the initialization of the application.
  • Replace the variable(Captured value variable) in the place of old session id(ABCDF) in the script.
  • Therefore when application is started, now the new session id is captured in a variable and passed to the next request. And the application will run without any error or failure.

Different types of correlation present in loadrunner?

  • Auto Correlation.
  • Manual Correlation.

Auto Correlation :

It is the easiest way of doing the correlation in the load runner application. VUGen will require you to run a recorded script at least two times so it can internally compare the varying values in the server response. Its seems the easiest way to do it but most of the time the auto correlation will not be working. Therefore it is not recommended to use this method.

One can configure automatic correlation at the time of recording using the below steps.

  • Create the rules in the Recording Option before recording the script . Click on Record =>Recording Options=>Rules.

Correlation Rules

  • Then make sure the scan for correlations applying is as per the below snap shot.

Correlation Configuration

Manual Correlation :

Its the most important  method used to capture the dynamic values in the loadrunner.  Its directly added the function into the script to capture the values and passed it.

Therefore below are the steps involved in capturing the dynamic values.

  • Identify the dynamic value in the script which need to handled.
  • Find the first occurrence of the dynamic value in the script.
  • Find the correct left and right of the dynamic values.
  • Add web_reg_save_param function to the script above the request where the first occurrence of the dynamic value was found.
  • Pass the correlated values in the script.

Click on web_reg_save_param to know the important parameters of the function.

Correlation Manual

What is Parameterization?

Parameterization

What is Parameterization?

Parameter is a container which is used to hold the values which are used in Vugen script.  Parameterization is used to send the different values(Unique values) to the Vugen script  from the parameter file. It will helps a single virtual vuser to use different data on each run. This simulates real-life usage of an application as it avoids server from caching results.

Example : During the test execution we need to use different username to log into the application. So instead of creating different script with different user name, we can create a single script and parameterize the username value. Therefore during the execution the parameter will send the unique values to application for login.

Different type of Parameterization present in LoadRunnner

Below are the list of parameter present in load runner which will be used for specific purpose.

Date/Time : 

  • Date/Time parameter replaces the value in the script which contains date or time.
  • There are multiple format o combination present in the date/time.
  • One can add there own format or prefix with the words along with date/time representation. It is mainly used to create unique names like customer name during the script execution.
  • During execution if you want the script to replace the date/time parameter only once or for each iteration or each occurrence. Therefore  you need to select the value appropriate to your condition from the Update Value on drop down menu.Parameterization DataTime

File:

  • It is used to pass the specific values to the application.
  • You can combine two file parameter into one using common or tab separator.
  • One can specific from which line the values need to be picked from the parameter file in First Data Line field.
  • Specific how the next row of data can be picked like Sequential or Unique or Unique or Select line as per other parameter in the Select Next Row field.
  • Update Value on field is used to specific when to pick the next data in the parameter like Each iteration or Once or Each Occurrence.
  • Most importantly you need to specific what should the script do if the data in the parameter file is finished. Continue with the last value or Abort script can be selected in When Out of  Values filed.

Parameterization File

Group Name:

  • We can generate a parameter on the basis of group that we select on controller for the script while execution.
  • This parameter will only work while running the script on controller.
  • One can add there own format or prefix with the words.

Parameterization Group

Iteration Number:

  • It will use the current iteration number in parameter file.
  • Used to see which iteration was failed during the execution.
  • It can also used to do some logic in the script. That is on how many iteration your export transaction should run.
  • One can add there own format or prefix with the words.

Parameterization Iteration

Load Generator Name :

  • You will get to know which load generator was used for your execution. Therefore you can check if there is any issue with the load generator.
  • Parameter only works while running the script on controller or performance center.
  • It can also used to check if the script is failing due to any one specific lg using this parameter.
  • One can add there own format or prefix with the words.

Parameterization LG

Random Number :

  • One can generate random values in this parameter file.
  • You can also specific the min and max values. Therefore the random value will be generated between in the min and max values.
  • Update Value on field used to specific when the value need to be generate.

Parameterization Random

Table :

  • Table parameter is same as File Parameter.
  • It is used to pass the specific values to the application.
  • You can combine two file parameter into one using common or tab separator.

Parameterization Table

Unique Number :

  • It will generate the unique value in this parameter.
  • One can also specific what should be the starting number of the unique value in Number range : Start filed.
  • Number of unique values for each user can be specified in Number Range : Block Size Per Vuser field.
  • Update Value on field used to specific when the value need to be generate.
  • Most importantly you need to specific what should the script do if the data in the parameter file is finished. Continue with the last value or Abort script can be selected in When Out of  Values filed.

Parameterization Unique

User  Define Function :

  • It is used to create you function where you need to pass some specific type of values.
  • Function Name can be specified in Function Name field.
  • You can browser some missing dll to the script in this parameter file.

Parameterization User

Vuser ID :

  • It will be used to provide a unique value for each Vuser id during the execution.
  • One can add there own format or prefix with the words.

Parameterization Vuser

XML :

  • XML Parameter Types are used for multiple valued data contained in an XML structure.
  • This parameters are widely used with Web Service scripts and with SOA services.

Parameterization XML

How to record Ajax TrueClient script in Load Runner?

Ajax TrueClient Scripting

TrueClient Protocol or TrueClient Scripting is getting more popularized in the recent times. It will give you the client side metrics like how long the page took to load the images. So customer are really intersected to know the time taken to render the application.  Therefore the TrueClient scripting or protocol is getting more important and popularized.

How to Record Ajax TrueClient Script in Load Runner

1: Launch  the Vugen Application.

2: Select a new script from the Vugen and then TrueClient - Web Protocol from the protocol windows as show below.

3: Once the TrueClient Script window is displayed. Navigate to Record -> Develop Script or Click on Develop Script from the shortcut displayed. Develop script mode will be launched. (Note : Recording, Adding Transactions and parameterization or any action on the script need to be done in Develop mode only. Therefore you cannot edit or do any change in the view mode in Ajax TrueClient). Develop mode consist of two panel,

  • First panel is TrueClient panel where you will be recording step of the user action and modification of script is done in this panel.
  • Second Panel which is a preview window, where application will be displayed and the action are performed. It is a same as the google browser where you can perform the actions.

4 : Click on record option from the TrueClient panel and paste the URL of the application in the browser(Second panel).

5 : After completing the recording of the user action. Stop button in the recording section should be clicked in the TrueClient Panel

6 : Run the script and validate the script if the script have successfully completed. Once running the script completed you will seen Replay Successful and importantly all the step will have tick mark beside it.

 

Record Web Services Script Using HTTP/HTML Protocol

You can use two different protocol to record the Web Service script in Load Runner. Below are the two protocol.

  • Web - HTTP/HTML  Protocol.

  • Web Services Protocol (Click on topic to know how to script using Web Service Protocol)

In this post we will know how to record the web service script using Web - HTTP/HTML protocol. We can use many input format to script the web service script such as XML, WSDL etc. Most used and important input format used for web service scripting is WSDL. So we will take the important input format used to script for the demo.

WSDL used for scripting in this post is : https://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl

Web Services HTTP/HTML - Scripting using Web - HTTP/HTML Protocol

Step 1 : Launch the Vugen application.

Step 2 : Select the Web - HTTP/HTML protocol from the Protocol section. Enter the script name and directory where the script need to be saved. Then click on create button.

Vugen Recording Window

Step 3 : Once the main explore is displayed. Then you need add the web custom request to your script by going to Design -> Insert  in Script -> New Step.  Steps Tool bar will displayed as shown the below image.

Step 4 : Search for web_custom_request in the steps tool bar and click on it. Most important window will be displayed therefore follow the below steps.

  • Enter the end point of the WSDL in the URL section of the window.  (Refer the step 5 to know the end point )
  • Paste the XML of the request in the body section of the window.
  • Then select the request(from top to bottom) in the body section and right click.
  • Select the Convert to C format from the menu of right click.
  • Once the conversation is completed then click on OK button.

Custom window

Step 5: If we not sure how to get the end point of the WSDL and the request then check below image.

  • Copy the WSDL and then open SOAP application. Click on empty soap project. Enter the WSDL in wsdl section and click ok.
  • WSDL will be loaded and all the request will be loaded.
  • Click on the request you want to script.
  • Endpoint will be loaded at the top and the below the request will be displayed.

Soap

Step 6: Web Service script will created. Later run the script and you will see the results in the output window. (If the result is not show in the output window then open the run time setting -> Log -> Enable logs -> check the Extended log boxes).