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).

 

Record Web Services Script using Web Services Protocol

We can record web service script using two protocol as mentioned below. Selection of the protocol will depend mainly on the licence available for the protocol

  • Web - HTTP/HTML  Protocol.

  • Web Services Protocol.

We will see how to record the web service script using web services protocol.

 

Web Services Protocol

Launch the Vugen application.

Select the Web Service Protocol in from the protocol selection window.(Click here to get the information about section and its fields).

Click on SOA Tool from the menu bar of the Vugen application. And select the Manage Services from the SOA Tools drop down. Then  you need to click on import button in the Manage Services Window.

Web Service Import

Once the import window is displayed therefore you need to enter the WSDL which you need to to create the web service script in the Vugen. After entering the WSDL then click on import button.  Sample WSDL which used to demo (https://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl).

Import WSDL

Successful import of the WSDL, all the details of the WDSL will be loaded. Then click on OK button.

WSDL Import Window

After that again click on SOA Tool from the menu bar and select the Add Services Call. Here is where you need to select the service which you want to add for the script. Importantly there will be multiple services in the WSDL so you need understand which service you need to add for the scrip.

  • In this section all the WSDL which is added in the manage service will be displayed so select the WSDL from the service section drop down. Below only one WSDL is displayed as we have added one WSDL.
  • Once you select the WSDL in Service section, all the Operation related to that WSDL will be displayed in the drop down. You need to select the important operation which you want to script.
  • If you want to test your script using the Stub instead of real end point. You can check the override option therefore you can enter target end point to your stub end point.

Operation

Now most important part is to select the mandatory headers, user credentials, input and output parameter of the operation. Click on ok button

Input Parameter

Output Paramter

Output Parameter

Input Parameter

After clicking on OK button. Your Web service script is ready as show below therefore you can run the script.

Recording Option In VUgen Load Runner

Recording Option Present in Vugen

General => Recording:-

In Recording Option, the recording is one of the important ways of recording the scripting Vugen. They are

  • HTML - Based Script :

    • In HTML mode, only the end user action performed by the user will be capture. Therefore the script will have only the action which performed by user in form of web submit request.  The other url in the page will not be captured.
  • URL Based Mode:

    • All the urls present in that particular page will be captured in script. Most importantly all the java script in the page will also be recorded in this mode.  Any action or url which is not able to be captured by the HTML mode will be captured in URL mode.

Recording Option- Record Mode

 

General => Script:-

In Script section of recording option. We will see the basic information about the language which is used to record the script.  You can change the language before the recording of the script. Best practice not to change the language because we might be seeing some error during the scripting and modification. the protocol will be used. And some of the other important options as well where we can define it.

  • If you check the AUT box then all the AUT process which automatically be closed once the recording will be stopped.
  • Next option where you can explicitly specific how much think time it should be added after end of each transaction. If you check this box then the think time will be auto added with the specified value after each transaction.
  • So you can specific explicitly to generate the event log for recording. It will contain what are the action which we performed during recording of the script step by step.
  • Even we can specif to generate a think time if a particular request take more than the time specified in this section.
  • Importantly the Number of lines to be there in each action will be specified here. If your script is very long and your script flow will be taking more than 60000 lines then you can change the number of lines here.

General => Protocol :-

Here you let you know what all type of protocol you have selected for this script. If you have selected multiple protocol during script creation  and you need only one protocol to record , so you can select the protocol which you need for recording. Example : Your using two different protocol for your script, one for logging into the application(Remote Desktop) and then your recording the script, therefore you can use  by selecting the required option in protocol section during recording.

General => Code Generation

If you want to search for the automation correlation in the recorded script you can use this option. Importantly if you don't want to run the auto correlation scan after the script recording is completed then you can opt out of this option. And also it will search for Aysnc call in the recorded script, if you know that your application is not having any Aysnc call then you can unchecked this option. Therefore the best idea is to go with both the option checked.

Correlation => Configuration

It has three section in this configuration

  • First section is scan section, where it will scan for the Rules of auto correlation and after the recording and even in the replay log the scan will happen.
  • In second section you can select what values to be ignored and what api need to be used for auto correlation.
  • Third section where you will specif with which the text need to be compared.

Correlation => Rules

Here you can write your left boundaries and right boundaries for your auto correlation for each type of protocol in this section. Beside that even you you can import the correlation rules from different script and you can export the rules created in this script.

HTTP Properties => Advanced

It offers various settings related to HTTP binding. Reset context for each action, enabling this option instructs VUGen to reset all HTTP contexts between actions to their initial state before recording, providing a clean beginning for the recording session.

  • And snapshot of recording can be saved locally for reference.
  • Generation of web_reg_find  function for all the pages
  • It can add a comment to the HTTP error message from the server
  • It can parameterize  there server side names.
  • Generate Cookies and web socket traffic in the script.
  • Replace a parameterize with coded values and even you can add header to your scripts.

Network => Mapping and Filtering

It is the most important section where the traffic of the recorded script will go pass through and get recorded. We have three option in Mapping and filtering where each option will different purpose,

  • Socket level data:-
    •  Socket level data will select this option for most of the web browser application in recording option. Because the data which will pass from browser to Vugen will talk through sockets.
  • WINLet level data:-
    • WINLet level data will be used for Desktop application to record the traffic between the application.
  • Socket/WINLet Level data:-
    • By default option used for most of the application. Because only if there data is recording in this option we change to other option and try to record the script.

How to record VUgen web script(HTTP/HTML)?

How to record VUgen web script(HTTP/HTML)?

Below are steps used for recording the web scripts

Launch HPE VUgen application.

Vugen Page

Once the application is launched, click on File ->New Script/Solution.

Create New Script Window will  be displayed. Most important section needed be selected/updated.

  • Protocol:-

    • You need to select single or multiple protocol for your recording the application. For example :- If you are using multiple protocols like RDP for logging in and browser for recording end user action. Then you need to select multiple protocols. But most of the application we will be going with the single protocols.
    • Select Web - HTTP/HTML Protocol from the window.
  • Script Name:-

    • Enter the appropriate name of the script in the Script Name Section.
  • Location:-

    • Select the directory where you need to select the script in the script directory section.
  •  Click on Create Button

Vugen Recording Window

Click on Recording Option->Recording from the menu bar.Recording Option Window will be displayed with the following sections.

  • Action Selection:-

    • Select the action(Section) where you want the script to be recorded when you start recording.
      • Vuser_int where you will record the action such as login or one time action.
      • Action, its the important section where main end user action will be recorded. And also it will be used to iteration the functionality.
      • Vuser_end where you will record the logout part.
  • Recording Mode:-

    • Record; If you are recording the web application then you need to select the Web Browser. And if you need to the record the desktop application then select Desktop application.
    • Application, Select the web browser in which you will recording the application.
    • URL address : Provide the application path or the web url of the application.
  • Setting:-

    • Check the box when you want to start the recording in the Start Recording option.
    • Provide the directory where your script need be working.
  • Click on start Recording.

Vugen Recording Section

 

Recording window will be opened. Where you can enter the transaction names, comments during the Recording phase. And even here you can change the action where scripts need to be recorded.

Vugen Recording Secition

Click on Stop Button, the script will be recorded and displayed as shown below. Script recording is completed you can start the modularisation of scripts.

Write your queries in the comment section will get back to you as soon as possible.