Create New Script

In the workload modelling you decide the flows in application to record. So before you start recording the script, you should have the following details of the application,

Pre-requisite:

For example:

URL:

Username:

Password:

Application flow to record:

Once you have above details you can start recording the script using VuGen -> New Script

1. Click New Vuser Script in the Scripts tab in the VuGen Start Page.

The New Virtual User dialog box opens, displaying the options for a new single protocol script.

It shows the list of all protocols supported by VuGen. Make sure the Category type is All Protocols. VuGen displays a list of all of the available protocols for a single protocol script. Scroll down the list, select Web (HTTP/HTML), and click OK to create an empty Web script.

Choose Vuser > Start Record or click the Start Record button in the Toolbar at the top of the page.

Enter the URL of the application and in the Record into Action choose Action.

Note: After recording you can modify the action name and the codes in it

Click on Options button, It will take you to Recording Options window.

In the General tree select Script, here you can choose the language in which you want VuGen to record the script. Languages like C, Java. Depending on the license constraint you can choose the language.

In the General tree select Protocols, it will show the selected protocol.

Select Recording it will show two options HTML-based scripts, URL-based scripts. Choose former it is easy to work with. But depending on the requirement you can choose URL-based script, conditions like catching correlations.

Click Ok and start recording.

Your application will be opened in Internet explorer and the floating Recording toolbar opens.

2. Log on to the web application.

Enter the User and Password. Click Login

3. Record the application flow mentioned in the requirement. Follow the below given nomenclature while giving the Action and transaction names:

ScriptNumber_TransactionsNumber_ActionName_TransactionName

S01_T01_Launch_LoginClick

4. Insert Comments for better understanding

5. Insert content check by selecting the text on the page. We can use this to check if the page is loading properly or not.

6. Log off if it is mentioned in the application flow.

7. Click Stop on the floating toolbar to stop the recording process.

8. The Code Generation pop up window opens while the Vuser script is being generated.

9. Choose File > Save. VuGen saves the file in the LoadRunner script folder and displays the test name in the title bar.

You have now recorded a web application flow logging in, booking flight and logging off. VuGen recorded your steps from the moment you clicked the Start Record button to the moment you clicked the Stop button.

You can now view the script inside VuGen. You can view the script in Tree view or Script view.

Script view is a text-based view that lists the actions of the Vuser as API functions. To view the script in Script view choose View > Script View or click the Script View button.

In Script view, VuGen shows the script in an editor with colour coded functions and their argument values. You can type C or LoadRunner API functions, as well as control flow statements, directly into this window.

Note: LoadRunner uses ANSI C. As your scripts become more advanced, you can leverage C to extend LoadRunner beyond record and playback.

Playing Back Your Script >>

One Comment

  1. karthik bk says:

    Fantastic Learning site………Given wonderful Information

Leave a Reply