31
Krish Hegde 1 LoadRunner Controller • LoadRunner Controller controls a Scenario and all its components such as Vusers, Hosts, Scripts. • LoadRunner Controller plays the role of a Moderator. ie Add & Monitor Vusers. • View complete details on Vusers, hosts, Scripts, status etc.

LoadRunner-Creating Load Runner Scenarios Chapter 3

Embed Size (px)

Citation preview

Page 1: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 1

LoadRunner Controller

• LoadRunner Controller controls a Scenario and all its components such as Vusers, Hosts, Scripts.

• LoadRunner Controller plays the role of a Moderator. ie Add & Monitor Vusers.

• View complete details on Vusers, hosts, Scripts, status etc.

Page 2: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 2

LoadRunner Controller

Page 3: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 3

Create a Scenario

Page 4: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 4

Configure Scenario

Step 1:Create a New Scenario & Save the Scenario in a Data Drive.

Step 2: Add VusersStep 3: Add HostsStep 4: • Add hosts to Host List• Add Scripts to Scripts List• Add Vusers to Vuser GroupsStep 5: Configure Scenario

Page 5: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 5

Review Scenario

• Review Scenario and all its Components.

• Check whether the Scenario can fulfill test objectives.

• Review Scenario Configuration

Page 6: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 6

Add Hosts

Page 7: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 7

Add Scripts

Page 8: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 8

Relative paths for Vuser Scripts

When you specify the location of a Vuser script, you can specify a relative location. The location can be relative to the current scenario directory, or the LoadRunner installation directory.

You can specify a path relative to the current scenario directory by typing either of the following notations at the start of the script path:

1. .\ indicates that the path is relative to the location of the scenario directory.

2. ..\ indicates that the path is relative to the location of the parent directory of the scenario directory.

Page 9: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 9

Create Vuser Groups

Page 10: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 10

Create Vusers

Page 11: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 11

Rendezvous Points

• During a scenario run you can instruct multiple Vusers to perform tasks simultaneously by using rendezvous points. A rendezvous point creates intense user load on the server and enables LoadRunner to measure server performance under load.

• You ensure that multiple Vusers act simultaneously by creating a rendezvous point. When a Vuser arrives at a rendezvous point, it is held there by the Controller. The Controller releases the Vusers from the rendezvous either when the required number of Vusers arrive, or when a specified amount of time has passed.

Page 12: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 12

Rendezvous Points

• Using the Controller, you can influence the level of server load by selecting:– which of the rendezvous points will be active during the scenario– how many Vusers will take part in each rendezvous

• For example, to test a bank server you could create a scenario that contains two rendezvous points. The first rendezvous ensures that one thousand Vusers simultaneously deposit cash. The second rendezvous ensures that another thousand Vusers simultaneously withdraw cash. If you want to measure how the server performs when only five hundred Vusers deposit cash, you can deactivate (disable) the “withdraw” rendezvous, and instruct only five hundred Vusers to participate in the “deposit” rendezvous.

Page 13: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 13

Configure Scenario

• Before you run a scenario, you can configure both the host and Vuser behaviors for the scenario.

• The default settings correspond to most environments.

Page 14: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 14

Runtime Settings

Page 15: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 15

Configure Output file

Page 16: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 16

Set timeout

• LoadRunner enables you to set the timeout interval for commands, pinging of hosts, and Vuser elapsed time.

• The command timeouts relate to hosts and Vusers. The host commands for which you can specify a timeout interval are Connect, Disconnect, and Heartbeat. The Vuser commands for which you can specify a timeout interval are Init, Run, Pause, Abort.

Page 17: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 17

Set File path

• When you run a scenario, by default the run-time files are stored locally on each Vuser host. (the machine running the Vuser script) The default location of the files is under the temporary directory specified by the host’s environment variables.

Page 18: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 18

Configure Hosts

• Before you run a scenario, you can indicate which hosts will run Vusers in the scenario. For example, if a host is unavailable for a particular scenario run, you can exclude it temporarily instead of removing it entirely from your list of hosts.

• You select which hosts will take part in the scenario by using the Enable and Disable commands. Disabling a host temporarily removes it from the list. Enabling a host reinstates it.

• Host tab>Details>Vuser limits

Page 19: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 19

Set Max Vuser for Host

Page 20: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 20

Preparing to run Scenario

• Before you run a scenario, you need to specify the location of the results (mandatory), assign a name to the results, schedule the scenario, and provide scenario summary information. In addition, you can specify the applications to invoke at the start of a scenario.

• Although most of the pre-scenario settings are optional, by using them you can enhance the testing process. These values are scenario specific—you can set different values for each LoadRunner scenario.

Page 21: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 21

Specify results location

• When you run a scenario, by default the runtime files are stored locally on each Vuser host. After the scenario, the results are collated together and processed on the Controller machine.

• Alternatively, you can instruct LoadRunner to save the results on a shared network drive.

Page 22: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 22

Specify results location

Page 23: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 23

Using Test Director

1 Choose Options > TestDirector Connection to open a connection to a TestDirector server and database.

2 Open an scenario from the database (File > Open), or save the current scenario to the TestDirector database (File > Save As).

Page 24: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 24

Collating Results

• When you run a scenario, by default all Vuser information is stored locally on each Vuser host. After scenario execution the results are automatically collated or consolidated

• To disable automatic collation, choose Results > Auto Collate Results to clear the check mark adjacent to the option.

• To manually collate results, choose Results > Collate Results. If your results have not been collated, then LoadRunner Analysis will automatically collate the results before generating the analysis data.

Page 25: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 25

Schedule Scenario Run

• After you create a scenario, you select the Groups and Vusers that you want to participate in the scenario and run it manually from the Controller.

• Alternatively, you can use the LoadRunner Scheduler to set up a scenario to run automatically. You can set the start and duration time of the scenario and indicate which Groups should participate in the scenario. This chapter describes:

Page 26: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 26

Schedule Scenario Run

1. Open the Scheduler and select an event mode Choose Scenario > Scheduling from the LoadRunner Controller to open the Scheduler and select the Basic or Expert event modes. The Expert mode allows you to set up dependencies and schedule external events.

2. Schedule groups Add existing Vuser groups to the scenario schedule and set a starting time.

3. Set the timing properties Set the timing related specifications for the scenario such as duration, initialization, ramp up, and ramp down.

4. Create and schedule external events Define delays and external events, and schedule them at the desired points. This setting only applies to Expert event mode.

5. Specify dependencies and sequences. Specify dependencies of one group upon another or indicate an event sequence. This setting only applies to Expert event mode.

6. Save the schedule and run the scenario. Save the setup and run the scenario from the Scheduler interface. The test runs according to your settings.

Page 27: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 27

Managing Scenario using TestDirector

• LoadRunner works together with TestDirector, Mercury Interactive’s test management tool. TestDirector provides an efficient method for storing and retrieving scenarios and collecting results. You store scenarios and results in a TestDirector repository and organize them into unique groups.

• The Controller’s Tools menu contains two menu items related to TestDirector. The first item, TestDirector Connection changes the test repository from the standard file system to the TestDirector database. The second item, TestDirector, invokes TestDirector.

Page 28: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 28

Open connection to TestDirector

Page 29: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 29

Open Scenario from TestDirector

Page 30: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 30

Save Results in TestDirector

• Before you run a scenario, you set the results location. If you have a connection open to the TestDirector project, results are saved to the default test set. You can also save the results to a new or existing test set, or to disk using the standard file system.

Page 31: LoadRunner-Creating Load Runner Scenarios Chapter 3

Krish Hegde 31

• Questions?