banner



What Is The Use Of Web Services Cal View In Loadrunner

What is VUGen?

VUGen (Virtual User Generator) is a key tool in LoadRunner to create testing scripts to emulate real-user behavior on your system. In VUGen, a human is replaced past a virtual user (VUser) and the actions performed by a VUser are recorded in VUser script to emulate the existent-user behavior for testing and monitoring.

VUGen is one of the four core components of LoadRunner. It is the outset component you interact with when getting started with Performance Testing using HP LoadRunner.

Let's understand a few salient features related to VUGen

VUScripts: As already described, the purpose of VUGen is to create VUScripts that are used to simulate a real-like virtual-user.

Actions: An action is fix of user transactions performed in the System Under Load to attain a defined task. An activity tin can be compared to a function in other programming languages. Each Vuser script has iii default functions

  • Vuser_init(used to login into the application)
  • Action (used to record the business process)
  • Vuser_end (used to logout of the awarding)

VUGen not just records scripts but likewise replays them (for just 1 VUser) to ensure script is recorded correctly. In one case you ensure the script is recorded correctly you contain information technology in a LoadRunner scenario

In this tutorial, you are going to report

  1. The script development process in VUGen
  2. Compare recording betwixt QTP and LoadRunner
    • Introduction to Web Tours Awarding
    • Understanding the VUGen Environment
  3. Creating Your First VUGen Script
    • Using Transactions at Record Time
    • Insert Comments at Record Time
    • Code Generation
    • Deciding a Protocol and Protocol Counselor
    • Recording Options
  4. Playback a Script and agreement Log
  5. Overview of Files Generated During Record & Playback

The script development process in VUGen

Understanding VUGen in LoadRunner

1. Tape the Script: Usually, this is the first step of scripting where every user action is recorded into a script.

2. Replay and Verify: One time the script is recorded, reply the script to ensure its working correct. Verify any impact through awarding frontend or database.

3. Enhance the Script: Once recording has been verified, enhance script by calculation checkpoints, validating data, adding transactions and rendezvous points.

four. Replay and Verify: As earlier, re-play your script and verify that everything is working as intended.

5. Configure Runtime Settings: Configure and control pacing duration, think time variation, proxy settings and whether yous wish to ignore any external resources.

6. Use for Load Scenarios: Formulate load scenarios based on examination objectives. Use load distribution and geo-broad agents to brand real like scenarios.

Compare recording between QTP and LoadRunner

VUGen disregards UI Objects:

Unlike QTP scripts, LoadRunner scripts are independent of GUI. This is because the lawmaking generated does not work based on UI objects, rather, it works on the principal of client'southward request to the server and expecting server response dorsum to the client. This is why replaying LoadRunner scripting is always browser independent. The VUser tin communicate directly with a server past executing calls to the server API-without relying on client software (SUL) this means in that location will no impact on scripts if the changes are fabricated to the UI of the Arrangement Under Load. This tells; the Performance Testing is completely based on client/server communication (request and response) and non the GUI objects.

Please refer to below link for more details: http://youtu.be/FDORUeqpNJs?t=3m41s

We will see in more details how VUGen scripting works below.

Introduction to Web Tours Application

For all hands-on purpose, nosotros volition be using the Web Tours Application that comes bundled with LoadRunner.

The HP Spider web Tours require a dependent "Web tours Apache server" to be running before it can operate. To run the Web Tours Apache Server, become to Start Menu => HP Software => Samples => Web and and then click on Start HP Web Bout Server.

Understanding VUGen in LoadRunner

Once the "server" has been activated, information technology will open a trounce and output on the panel.

The console should look like snapshot below, look for your IP address in the shell:

Understanding VUGen in LoadRunner

Notation: if you close this window, the server volition stop.

At present you tin admission the Spider web Tours Application –

Understanding VUGen in LoadRunner

Once launched, it will await like –

Understanding VUGen in LoadRunner

Understanding the VUGen Environment

To run the VUGen, double-click on the VUGen shortcut from the desktop, or go to Starting time Card => HP Software => and and then click on Virtual User Generator.

Understanding VUGen in LoadRunner

VUGen splash screen volition appear as follows

Understanding VUGen in LoadRunner

The splash screen will subsequently open HP Virtual User Generator Dwelling house page, as shown below:

Understanding VUGen in LoadRunner

From the File menu, y'all tin observe various command controls. The purpose of these controls are mentioned below:

Understanding VUGen in LoadRunner

New Script and Solution: is used to start creating a new script. Alternatively, you can create a new script from the toolbar button.

Open >> Script Solution: is used to open an existing, previously created script or solution from a directory.

Add >> New Script: is used to add a previously created script into the electric current solution

We will get acquainted with other controls as nosotros starting time creating our first script. Let's proceed learning.

Click here if the video is not accessible

Creating Your Start VUGen Script

Earlier you record, make sure the Spider web Tours App server is running. Recall, you demand to go along the server running so exercise non close it. If the window bothers you, y'all tin can minimize information technology.

Tip: In a existent-world trouble, ane needs to get acquainted with the subject application (SUL) specially if it involves complex business workflows and data stages. You can also collaborate with HP Web Tours to ensure you can repeat the exact steps when recording.

Before one tin can first with scripting of any application (SUL), one needs to get acquainted with the application flow. With this tutorial, permit's get acquainted with HP Spider web Tours which is shipped and automatically installed with HP LoadRunner.

Step 1) Click on File =>New Script and Solution every bit shown in the snapshot below:

Understanding VUGen in LoadRunner

You can employ the shortcut (Ctrl + Northward) to do the same.

Footstep 2) A window to select the protocol is shown. The listing looks slightly dissimilar from previous versions

i. Select Single Protocol

two. Spider web

3. Enter Script Name

4. Click Create

Understanding VUGen in LoadRunner

Annotation: You can use Protocol Advisor to determine right protocol your awarding uses for advice. For HP Spider web Tours, we already know that it requires "Web – HTTP/HTML" protocol. We will larn at a afterwards stage how to determine the correct protocol for your SUL.

Tip: An awarding may crave more 1 Protocols sometimes to communicate with its server. For such a case, navigate to Multiple Protocols listing on the left side of window.

Understanding VUGen in LoadRunner

HP Spider web Tours, nevertheless, requires only one protocol when scripting with VUGen.

Tip: You cannot rename your scripts easily, so be creative when giving your scripts a name. If y'all've to rename a script, use Relieve As feature and requite a new proper noun. A adept classification could be something similar WT01_Signup where WT is a short grade of the awarding name, 01 is a business process sequence, and Sign up refers to the business processes being scripted. Also, note that y'all cannot utilise spaces in a script proper noun.

Step iii) once you click Create, HP VUGen will open the IDE (Integrated Development Surround) or code editor. You lot tin can notice the script files are blank, except basic signature of Function Action. Below snapshot should assist empathise it more:

Understanding VUGen in LoadRunner

Step iv) Click the Recording buttonUnderstanding VUGen in LoadRunner which you tin can find in the toolbar. Refer to the snapshot beneath:

Understanding VUGen in LoadRunner

Pace 5) a new window opens

Understanding VUGen in LoadRunner

1. If nosotros study the above window, the proper noun of the script is mentioned in the championship bar of this popup. This volition assist you make changes to the right script when yous are dealing with multiple scripts opened at a time.

ii. If you lot do non see the residual of controls, click on the Fewer Options button to ensure you are not viewing fewer options.

iii. Record into the activity field determines where the code is generated after recording. VUGen scripts facilitate switching to other actions or creates new actions during and after recording.

iv. Record: field tells VUGen that the discipline application (SUL) is a web application or a desktop client. This pick cannot be overridden once recording begins.

v. Awarding: field tells VUGen, which browser to employ for recording. If you lot are not working with Web – HTTP/HTML protocol, you volition select the desktop client with this field.

Tip: Different QTP scripts, LoadRunner sample scripts are independent of GUI. This is because the code generated does not work based on UI objects, rather, it works on the principle of customer's request to the server and expecting server response dorsum to the client – ordinarily, in the form of HTML (hence the name of a protocol)

vi. URL Address: The URL of the SUL is input here. VUGen will invoke this URL when "Start Recording" is clicked. The browser used will be the ane mentioned under "Record:" field if it is different from your default browser.

seven. Start Recording: Firsthand vs. Delayed: If you've selected Immediate recording mode, you lot will notice that VUGen starts recording events as soon every bit you hit "Start Recording" button. However, if y'all select Delayed recording mode, the VUGen volition invoke the system (SUL) but will not commence capturing events unless y'all click on the Recording button from the floating bar.

8. Working Directory: This is a temporary directory which VUGen volition use while capturing events. A copy of your script will be bachelor at this location every bit well, just in instance if you lose your binder 🙂

9. Recording Options: These settings tell VUGen what type of URLs to capture and what recording manner to use.

x. Start Recording: Volition start recording. Click on information technology

Step 6) Once recording starts, VUGen volition invoke the HP Web Tours application using the browser selected.

Let's empathize with a LoadRunner scripting example to Sign upward a user at Spider web Tours application and record a basic script.

Understanding VUGen in LoadRunner

Understanding VUGen in LoadRunner

A floating recording bar will appear which will offer various controls over recording. This tells the fourth dimension elapsed and a number of events automatically captured. Allow'southward look at the floating bar closely.

Understanding VUGen in LoadRunner

In the snapshot shown above, the SUL has fired 56 events and a total of 0 minutes and 25 seconds of time duration has elapsed since recording began.

You lot'll likewise notice that no events are fired as y'all blazon. Ask yourself why. Can yous answer?

This is because no customer to server communication takes identify as you type. Hence, no events are fired and no script is generated regarding typing. The lawmaking volition be generated just once yous submit the grade (click Continue)

Recording tin be pause Understanding VUGen in LoadRunner using the break button. Please note, as long as the recording remains paused, all events beingness fired by the application will be disregarded. This also means that even if your application is sending requests and/or receiving response course SUL, the script volition non be generated as long every bit y'all've paused the recording.

If you've paused recording, you will demand to click recording Understanding VUGen in LoadRunnerpush from the floating bar to resume recording.

While you are recording in vuser_init section, you lot'd notice that rendezvous push button is not enabled. Switch to Action (or create a new Action) and keep recording. Refer to beneath snapshot to larn how to switch Action.

Understanding VUGen in LoadRunner

You'll notice that later switching to an Action, the rendezvous Understanding VUGen in LoadRunner button will exist enabled automatically. This is because VUGen does non let insertion of rendezvous points in vuser_init.

Using Transactions at Record Time

Let'due south assume you wish to gauge response time when X number of users simultaneously Sign up. To address this objective, let'due south read further.

By now you lot've recorded opening of the application in vuser_init action. After you've switched to Activity, enter the user information required by SUL. Now earlier you striking "Continue" push button, follow beneath steps:

Starting time a transaction by clicking buttonUnderstanding VUGen in LoadRunner in floating bar. Enter the name of the transaction, for example, 01_Signup.

Tip: It is a good do to proper name your transaction with a prefix like 01_ to assist keep them unique.

The floating bar volition look like this:

Understanding VUGen in LoadRunner

Click OK to shut the transaction label.

Click the Proceed button of the awarding.

End transaction by clicking buttonUnderstanding VUGen in LoadRunner. Select the name of the transaction you wish to close, for example, 01_Signup in this instance. Refer to below snapshot for analogy.

Understanding VUGen in LoadRunner

If you do non accept multiple transactions opened, yous'll see only one proper noun. If you lot've multiple, however, you'll 0be able to select from the list.

Insert Comments at Record Time:

Now that you've successfully closed the transaction, you tin put a annotate at record time to give yourself a reminder when yous study the code later. From the floating bar, click on the button to insert a comment. A text box volition appear adjacent to the floating bar where you tin can enter any text.

Understanding VUGen in LoadRunner

This annotate will be inserted into the code after the steps (code) you've just finished earlier clicking OK push.

From the application, you tin click keep. You'll notice a welcome notation by an application.

Now select vuser_end activeness and click Sign off from the application. Shut the application and click stop button Understanding VUGen in LoadRunner from the floating bar.

Code Generation:

One time recording has been stopped, you'll notice VUGen post generation activity. This includes generating code, transactions, and comments based on your recording. Refer to snapshot below.

Understanding VUGen in LoadRunner

Immediately later on VUGen finished "Performing post generation operations" it will start "Performing scan for correlation post generation operation" We volition run across in more than item what correlation means.

Understanding VUGen in LoadRunner

Once post generation performance is finished, you will see Pattern Studio window. If whatever candidates for correlation are institute, you'll be able to review them in this window.

Understanding VUGen in LoadRunner

Y'all can safely click on the Shut button, and VUGen volition accept you lot to the lawmaking that has been generated.

The window will look like this:

Understanding VUGen in LoadRunner

Every bit highlighted in the above figure, the editor contains piece of cake to understand, readable lawmaking. You can accept a look on the parameters used while recording.

The left side of VUGen is chosen Step Navigator that lets you understand the "script" without looking at the granularities of the code. For example, you can read steps as, opening a URL, spend Retrieve Time and submit the form. This encapsulates all the parameters associated with each request.

Your script has been generated, click on the File card and then click on Save Script Every bit to browser the location where you wish to save your script. VUGen will automatically suggest the terminal directory used if you've already saved a script before. The proper noun suggested volition be the proper noun you mentioned when you started recording.

All done.

Now, congratulate yourself for having your offset script successfully generated and saved.

Deciding a Protocol and Protocol Advisor

Y'all might have questioned yourself why did we use Web – HTTP/HTML protocol. How did we decide which protocol should we utilise? The respond is non that uncomplicated.

At that place is an architectural foundation set of skills you need to have in identify as a prerequisite to answering this question. If you lot are a beginner, you tin can pair up with someone who has solid client-side architectural and evolution skills for your SUL. You tin can speak with the developers of your SUL and discover out which interfaces your application leverages. This should lead you on a natural path to the interfaces that you will be using for your virtual user script development and protocol pick.

To address the needs of beginners less knowledgeable in architectural skills, LoadRunner introduced a characteristic chosen Protocol Advisor in LoadRunner 9.one. While this has made life easier for many, 1 should rely more than on the architectural and development skills instead of protocol advisor and receiving information from the development squad about underlying development technologies. Protocol may not advise right protocol in all cases.

To use Protocol Advisor, go to Record => Protocol Advisor => Analyze Awarding

Refer to snapshot below:

Understanding VUGen in LoadRunner

This will open the main window of Protocol Advisor. If yous discover, this resembles a bit with the window appearing for recording. Permit's have a look at the window below:

Understanding VUGen in LoadRunner

Select the Web Browser since we are using a spider web-based application.

Specify the URL of the application that will later on exist invoked. Working directory can be left as such since this is merely a temporary directory for VUGen to utilise. Ensure you've read and write access on this directory.

Click the Start Analyzing button.

A floating bar, somewhat similar to the record time floating bar will announced. Have a look at the snapshot:

Understanding VUGen in LoadRunner

The process will tell the fourth dimension elapsed and a number of events fired. Even so, this data is not necessary. The just do good of this events counter is, you know your customer, SUL, is communicating with the server.

It is a good exercise to clarify only i business concern process at a time since the diverse concern process in a large enterprise application may involve diverse protocols. For example, a dashboard in some application may have Ajax or Flex, etc. but this will not be present on the login page.

Once you've finished executing a particular concern process, you can hitting the Stop push. The VUGen protocol advisor will come upward with a summary study on the protocol suggestion. Have a expect how it looks similar:

Understanding VUGen in LoadRunner

Yous can run across the suggestions from Protocol Advisor. These may or may not be the best choices to pick.

You've learned to use Protocol Advisor by now. Withal, this could be helpful for beginners or for a situation where you lot need "another opinion" – rely on your architectural sense, programming knowledge, evolution skills and data received from the development team to decide on the protocol.

Recording Options

Whenever VUGen generates a script, the code generated is based on various configurations that can be found under the "Recording Options" – or you can press Ctrl + F7 to view the Recording Options in LoadRunner.

Let's accept a look at recording options window before we discuss all configurations:

Understanding VUGen in LoadRunner

At that place are diverse categories of configurations like Full general, Correlations, Network and Data Format Extension. Allow'southward empathise almost significant among these, one by one.

General => Recording:

This topic requires detail understanding. Hence this is discussed separately.

General => Script:

Accept a look at the snapshot for a glimpse:

Understanding VUGen in LoadRunner

You'll notice that Linguistic communication dropdown is disabled. A mutual myth is that the LoadRunner does not generate code in any other language. Another myth is that it requires a license to piece of work in other languages.

Both are faux. LoadRunner decides for itself which linguistic communication to utilise when generating the script. In almost all cases, you'll find yourself working with C Language.

For certain Java applications (similar Java applets) the lawmaking being generated will be in JavaScript Language.

VUGen will generate a script in VBScript Language only for applications developed in Visual Basic classic (MS Visual Studio 2002)

Scripting Options:

You tin can opt to "Generate stock-still think time afterwards end transaction". This means, no matter how much a user wait, the think time generated (the delay) will be equal to value specified. The value is in seconds.

A maximum number of lines in the action file refers to the maximum number of lines VUGen volition generate an action. If the script is larger, VUGen will automatically create a new action. The default is fix to threescore,000. The maximum value which can be specified is 65,000

You may find this configuration helpful when dealing with a desktop application with Oracle on the backend.

General => Protocol gives you an option to select and deselect any protocols you've selected at the get-go of recording

Essentially, this will be used but when y'all wish to Re-Generate Script.

Accept a look at the screen:

Understanding VUGen in LoadRunner

This is helpful when yous've used multi-protocols at the fourth dimension of recording a script. You can regenerate the script and deselect the protocols y'all don't wish and get a new script without having to re-record it.

General => Code Generation:

Accept a expect at the snapshot below:

Understanding VUGen in LoadRunner

This configuration tells VUGen to find candidates for correlation at record time. If you do not wish for Automatic Correlation, and so you might wish to plough off this feature.

Correlation => Configuration:

Have a look at the screenshot below and familiarize yourself with the screen.

Understanding VUGen in LoadRunner

Although automatic correlation is helpful from 5% to 10% only, yet you can select "Rules Browse" and "Automatically correlate values constitute". However, if your script doesn't play, yous can consider restoring to defaults past clicking on a push button.

Correlation => Rules:

Go to Rules, and here yous can see various rules VUGen is using to notice correlation candidates. Y'all can add custom rules if you know what your application (SUL) is using equally parameters. Even so, this is an advanced utilize of record time settings. If yous're a beginner, you can safely skip this topic.

Understanding VUGen in LoadRunner

HTTP Backdrop => Advanced:

This frame offers diverse settings related to HTTP binding.

Reset context for each activeness, enabling this option instructs VUGen to reset all HTP contexts between deportment to their initial state before recording, providing a clean kickoff for the recording session. The option is enabled past default.

You tin can go out the residuum of configurations intact unless required.

Understanding VUGen in LoadRunner

Network => Port Mapping:

This frame should be left intact. If you're recording a desktop application, then you may have to choose WinINet level data.

Understanding VUGen in LoadRunner

Y'all tin can become to Options (as long as you're using Socket level data) and select various options like SSL version or other types of Secure Socket Layer. If yous're a beginner level or exercise not require these options, you can skip. Have a await to get yourself acquainted with the screen.

Understanding VUGen in LoadRunner

Now yous're done with most of the Record Time options, let'due south move to the side by side topic and sympathise the difference betwixt HTML and URL based scripting.

Difference between HTML-based and URL-based Scripting

Yous may accept noticed an option to choice either HTML-based script or URL-based script. Have a await at the snapshot for a flashback.

Understanding VUGen in LoadRunner

So what is this option and which i to selection?

The HTML-based script is based on user actions, and the scripts contain functions that correspond direct to the action taken. Let's understand case of a small piece of code:

Example:

web_link("Enterprise Systems Performance", "Text=Enterprise Systems Functioning," "Snapshot=t4.inf", LAST);

The URL-based script is based on HTTP requests sent to the server equally a result of user deportment.

Here is an case of lawmaking for URL style for the same actions performed as in a higher place (in HTML mode)

Example:

web_url("Enterprise Systems Performance", "URL=/esp.html", "TargetFrame=", "Resources=0", "RecContentType=text/html", "Referer=/atc?. . . , "Snapshot=t4.inf", "Way=URL", LAST);

Tip: Information technology's best to experiment yourself before you move forward. Change the record time settings and record the same script twice i.e. once with HTML style and in one case with URL mode – then compare both. Go along the script brusk and so y'all tin can understand the divergence.

How do we decide on which mode to use?

Let'south understand the pros and cons of both modes and then sympathize which mode is more suitable under certain situations:

Benefits of HTML Recording

  • Reduces need to capture dynamic values
    • Activity tag values and hidden data are Non hardcoded
    • They are retrieved from memory during playback
    • If they are dynamic, the VUser still run
  • Script is only every bit big every bit the business concern process–one stride per page

Disadvantages of HTML Recording

  • Scripts are less scalable
  • Memory (cache) is searched during playback
    • requires more than memory
    • requires more CPU power

Benefits of URL Recording

  • Flexibility
    • Support for Java Applets and ActiveX objects on the folio
    • Ability to replay on UNIX
  • Scalability
    • Scripts are more scalable than HTML scripts considering they require fewer resource

Disadvantages of URL recording

  • Scripts require more than correlation (nothing is retrieved from the cache)
  • Context-sensitive checks won't piece of work (parser is disabled)*
  • Scripts are large (all images and frames are recorded as separate steps)

Here is a quick illustration:

HTML Fashion URL Manner

Intuitive and piece of cake to empathize.

Not equally intuitive as the HTML scripts.

Scripts are smaller, requests are encapsulated and piece of cake to empathize.

Scripts are large, containing a telephone call to each image, css, html, etc. thus making information technology difficult to understand.

Scalable.

More scalable and effective for creating a load test.

Use of Re-Generate Script

Permit'south suppose you want to record the same script you lot just recorded, but with different tape time settings. In such a case, you can use the regenerate script feature.

Yous can access it nether Record => Regenerate Script or with hotkey Ctrl+Shift+R

Understanding VUGen in LoadRunner

Once y'all click on the menu, VUGen will give you lot a alarm that your existing script and all inverse you've made to your existing script will be lost. The alert bulletin looks like this:

Understanding VUGen in LoadRunner

You can also click on Options to open up Record Time Options from here.

Click OK to continue with Re-Generation of a script.

Playback a Script and understanding Log

In one case y'all've saved the script, y'all can click on the Understanding VUGen in LoadRunner in the toolbar to replay or hit F5.

Yous can find this button in the toolbar:

Understanding VUGen in LoadRunner

You need to ensure the server is running (which is required for application to work properly)

When you replay the script, you'll notice that unlike QuickTest Professional, information technology doesn't open any browser to replay. Recollect, this execution will simulate only 1 (single) user load on the SUL. The purpose of this execution is to ensure your script is working.

Understanding VUGen in LoadRunner

Tip: You'll need to verify the impact from the application itself. For case, if you're creating a record, go to the application and verify manually that your script actually created a tape. Your scripts, most likely, will not be tested past nevertheless another Testing or QA squad and then you lot demand to be very careful with your script and ensure these are thoroughly tested.

Y'all can leave the replay log active since this volition be a swell help in identifying candidates for correlation and any errors and warning you might come across. Since generating log takes ample resources, information technology is best-turned off when you're done with debugging of scripts and using them for scenarios.

Overview of Files Generated During Record & Playback

Permit's close the VUGen and have a look at the files it has created in the script folder.

VUGen creates a series of configuration files, information files and source code files which contain VUser run-time and setup information. The results of each iteration of the script are stored separately. If yous've executed your script at to the lowest degree once, yous volition notice a directory past the proper noun result1. This directory is for system use and should be ignored by the tester.

Important files which y'all demand to understand:

VUGen will create one .c (C Language Code file) for each action. Thus, at the concluding, yous'll have vuser_init.c and vuser_end.c and Action.c – if you've more actions created, you will run across corresponding files as well. For case, myAction.c

The replay log is saved in a file called output.txt. If you've replaced it multiple times, output.txt will contain the final execution log whereas, output.bak will comprise previous to the last run.

<script_name>.usr file will contain all the run time configurations you've customized. Even if yous've left all the configurations to default, this usr file will contain the information. This file also contains the version of LoadRunner used for creating a script. This information is helpful if you lot're reading quondam scripts for which you tin can't recall the version number.

You volition meet a folder named "data". This folder keeps an image of the events likewise as a copy of your code. VUGen makes use of these files when you "ReGenerate" your code.

What Is The Use Of Web Services Cal View In Loadrunner,

Source: https://www.guru99.com/understanding-vugen-in-loadrunner.html

Posted by: lamontbost1962.blogspot.com

0 Response to "What Is The Use Of Web Services Cal View In Loadrunner"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel