load runner recording with virtual user generator chapter 6

Upload: rajesh0201

Post on 30-May-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 Load Runner Recording With Virtual User Generator Chapter 6

    1/17

    Krish Hegde 1

    Developing Vuser Scripts

  • 8/14/2019 Load Runner Recording With Virtual User Generator Chapter 6

    2/17

  • 8/14/2019 Load Runner Recording With Virtual User Generator Chapter 6

    3/17

    Krish Hegde 3

    Developing Vuser Scripts

    1. You begin the process of developing a Vuser script byrecording a basic script.

    2. You enhance the basic script by adding control-flow

    structures, and by inserting transactions andrendezvous points into the script.

    3. You then configure the run-time settings. The run-timesettings include iteration, log, and timing information,and define how the Vuser will behave when it executesthe Vuser script.

    4. To verify that the script runs correctly, you run it instand-alone mode.

    5. When your script runs correctly, you incorporate it into aLoadRunner scenario.

  • 8/14/2019 Load Runner Recording With Virtual User Generator Chapter 6

    4/17

    Krish Hegde 4

    VuGen

    The Vuser Script Generator, also known as

    VuGen, enables you to develop Vuser scripts for

    a variety of application types and communication

    protocols. VuGen not only records Vuser scripts, but also

    runs them. Running scripts from VuGen is useful

    when debugging. It enables you to emulate how

    a Vuser script will run when executed as part of

    a scenario.

  • 8/14/2019 Load Runner Recording With Virtual User Generator Chapter 6

    5/17

    Krish Hegde 5

    Recording Vuser Scripts

    When you record a Vuser script, VuGen

    generates various functions that define the

    actions that you perform during the recording

    session. VuGen inserts these functions into theVuGen editor to create a basic Vuser script.

    You use VuGen to develop a Vuser script by

    recording a user performing typical business

    processes on a client application. VuGen

    creates the script by recording the activity

    between the client and the server.

  • 8/14/2019 Load Runner Recording With Virtual User Generator Chapter 6

    6/17

    Krish Hegde 6

    Recording Vuser Scripts

  • 8/14/2019 Load Runner Recording With Virtual User Generator Chapter 6

    7/17

  • 8/14/2019 Load Runner Recording With Virtual User Generator Chapter 6

    8/17

    Krish Hegde 8

    Transaction & Rendezvous

    functions

    lr_start_transaction: Marks the

    beginning of a transaction.

    lr_end_transaction: Marks the end of a

    transaction.

    lr_rendezvous: Sets a rendezvous point.

  • 8/14/2019 Load Runner Recording With Virtual User Generator Chapter 6

    9/17

    Krish Hegde 9

    Recording Vuser Scripts

    Each Vuser script that you create contains atleast three sections: vuser_init, one or moreActions, and vuser_end.

    During recording, you can select the section ofthe script into which VuGen will insert therecorded functions.

    In general, you record a login to a server into the

    vuser_initsection, client activity into theActionssections, and the logoff procedure into thevuser_endsection.

  • 8/14/2019 Load Runner Recording With Virtual User Generator Chapter 6

    10/17

    Krish Hegde 10

    Recording Vuser Scripts

  • 8/14/2019 Load Runner Recording With Virtual User Generator Chapter 6

    11/17

    Krish Hegde 11

    Recording Vuser Scripts

  • 8/14/2019 Load Runner Recording With Virtual User Generator Chapter 6

    12/17

    Krish Hegde 12

    DB Vuser scripts

  • 8/14/2019 Load Runner Recording With Virtual User Generator Chapter 6

    13/17

    Krish Hegde 13

    Recording Web Vuser

    Step 1: File > New> eBusiness (http/html)

    Step 2: Click on Record button

    Step 3: Enter URL and press OK Step 4: The web pages opens, start

    browsing the web page and perform

    actions Step 5: Stop recording

    Step 6: Run to debug the script.

  • 8/14/2019 Load Runner Recording With Virtual User Generator Chapter 6

    14/17

    Krish Hegde 14

    Insert Transaction Points

    Step 7: Insert Transaction Start and

    Transaction end points

    Step 8: Insert Rendezvous point

    Step 9: Run to debug script.

    Step 10: Insert Comments for reference.

  • 8/14/2019 Load Runner Recording With Virtual User Generator Chapter 6

    15/17

    Krish Hegde 15

    Using C Functions

    VuGen generates Vuser scripts in C. Allstandard ANSI C conventions apply to thescripts, including control flow and syntax.

    You can add comments and conditionalstatements to the script just as you do in other Cprograms. You declare and define variablesusing ANSI C conventions.

    There are many limitations for adding functionsin Vuser Script.

    Many C functions are not supported by VuserScript.

  • 8/14/2019 Load Runner Recording With Virtual User Generator Chapter 6

    16/17

    Krish Hegde 16

    Using C Functions

    However, since the interpreter that is used

    to run Vuser scripts does not support any

    Microsoft extensions to ANSI C, you

    cannot use Microsofts include files.

    It is better to use VuGen for recording

    Vuser Scripts compared to manual coding

    in C as there are many limitations inadding functions.

  • 8/14/2019 Load Runner Recording With Virtual User Generator Chapter 6

    17/17

    Krish Hegde 17

    Questions?