Skip to main content

Loadrunner Web Services Tutorial Scripting in Two Ways

Web Services in loadrunner: We can do web services scripting in two ways:
  1. By using Web Services Protocol. (Need additional License)
  2. By using Web Protocol.

Scripting using Web Services Protocol:

I have taken weather web service as example shown in this link.

Steps:
  1. First open the vugen and select Web Services protocol.
  2. Click on Manage Services on top nav bar and Click on Import and give the WSDL URL which is usually ends with wsdl

Now Click on Add Web Service Call on top nav bar. Give the Input Arguments and Leave the out put arguments empty. And click on ok. As shown in the following image.

Input Arguements in Web Services
Input Arguements in Web Services
It will create a script in loadrunner as shown below. You can perform the steps one by one in this way for all the web services steps. You can use lr_xml_find and lr_xml_get_values to validate the page.

web_service_call"StepName=GetCitiesByCountry_101",
        "SOAPMethod=GlobalWeather|GlobalWeatherSoap|GetCitiesByCountry",
        "ResponseParam=response",
        "Service=GlobalWeather",
        "ExpectedResponse=SoapResult",
        "Snapshot=t1396977083.inf",
        BEGIN_ARGUMENTS,
        "CountryName=India",
        END_ARGUMENTS,
        BEGIN_RESULT,
        END_RESULT,
        LAST);

Using Web Protocol:

We can create the same request using Web (HTTP/HTML) protocol. You need take the xml request as shown in the following and place in the web custom request.

XML Request Example for Web Custom Request
XML Request Example for Web Custom Request
You need to keep this soap request in the web request body. As shown below and you can capture all the response using correlation function. You can also add check point using web_reg_find. The url should end with .asmx as shown in the request.

web_reg_find("Text/IC=New Delhi",
        LAST);

  web_reg_save_param_ex(
        "ParamName=Web Service Response",
        "LB=",
        "RB=",
        SEARCH_FILTERS,
        LAST);

    web_custom_request("Weather SOAP Request",
      "URL=http://www.webservicex.net/globalweather.asmx",
      "Method=POST",
      "TargetFrame=",
      "Resource=0",
      "RecContentType=text/xml",
      "Referer=",
      "Mode=HTML",
      "EncType=text/xml; charset=utf-8",
      "Body= Your Request should be here as shown in the following image"
      LAST);

Web Custom Request with Web Services


Comments

  1. Very helpful post Sam. Thanks! In the request for "web_reg_save_param_ex", can you give some example response and left/right boundary. That will help others with correlation.

    ReplyDelete
  2. Usefull stuff for performance tester

    ReplyDelete

Post a Comment

Popular posts from this blog

NeoLoad Interview Questions and Answers

Here are some of the interview questions and answers on NeoLoad:
What is NeoLoad?
NeoLoad is a performance testing tool designed to test different types of web, standalone and mobile applications.
What is the difference between Loadrunner, JMeter and NeoLoad?
Click here for differences
What are the different counters you monitor in NeoLoad?
Average Response Time(requests), average response time(pages), average requests/s, average throughput, current response time(requests), current response time(pages), current requests, current throughput, current users count, controller cpu load, controller memory load etc.
What are the different type of tools you can integrate with NeoLoad?
App Dynamics, CA APM Integration, Dyna trace integration, HP ALM or Quality Center Integration, Java and Jamo Solutions M-eux Test Integration, Jenkins Integration, perfecto mobile integration, selenium integration.
What are the different type of Operating systems you can monitor?
Linux Monitor, Solaris Monitor, AIX …

Sitescope Monitoring Tool Features and Monitors

Why Sitescope is called Agentless Monitoring Tool?
HP SiteScope monitors the application/infrastructure/server/operating system without installing any agent software on the system to be monitored. This feature makes the installation, usage and maintenance of Sitescope simpler when compared with the any performance monitoring tools like Diagnostics.
Sitescope Monitors:
Sitescope has also upgraded and changed drastically to meet the rapidly changing technologies and environments like virtualization and cloud computing. Using Sitescope we can monitor different web servers, application servers and database servers. We can also monitor operating systems Windows, Linux, Sun Solaris, IBM AIX. It has more than 100 monitors including Weblogic, Websphere, SAP, SIEBEL, SNMP, LDAP, Network Monitor etc. HP SiteScope can also monitor cpu utilization, response time, disk space, and resource availability of a variety of host types and application platforms.
Sitescope Features:
SiteScope provides failover …

LR Functions with Examples | Loadrunner Functions with Examples

LR Functions in Loadrunner with Examples.

lr_abort Stops the script execution.lr_advance_param It will take the next value in the parameter list.lr_continue_on_error Continue on error even if the request is failed.lr_convert_string_encoding Converts a string to a UTF 8 or Unicode.lr_db_dataset_action Validates database contents by setting checkpoints.lr_db_connect Connects to a database.lr_db_dataset_action Performs an action on a dataset.lr_db_disconnect Disconnects from a database.lr_db_executeSQLStatement Submits an SQL statement to a database.lr_checkpoint Validates the value of a parameter against an expected value (checkpoint).lr_db_getValue Retrieves a value from a dataset.lr_debug_message Sends a debug message to the LoadRunner output or Application Management agent log file.lr_decrypt Decrypts an encoded string.lr_disable_ip_spoofing Disables IP Spoofing.lr_enable_ip_spoofing Enables IP Spoofing.lr_end_sub_transaction Marks the end of a sub-transaction.lr_end_transaction Mark…