wapt quick start

Upload: anishabataju

Post on 29-Oct-2015

46 views

Category:

Documents


0 download

TRANSCRIPT

  • 1Creating test scenarioYour work with WAPT starts with creating a testscenario. Here you will choose your test objectivesand specify basic parameters of your test, such asthe number of virtual users, type of load, testduration, etc.

    Click the "New" button on the toolbar to createa new scenario. This will launch the New ScenarioWizard.

    In this example we will create a simpleperformance test, so choose the "PerformanceTest" option on the first page of the Wizard. Click"Next" to continue.

    On Page 2 you can see the recommended typeof load for your test and specify its parameters. Forperformance testing it is recommended to useramp-up load. This means that the number of virtualusers will grow during the test, so that you cancompare the web site performance on different testphases depending on the changing load.

    Click the "Next" button to proceed to Page 3.

  • 2Test duration and reportoptions

    On Page 3 you can choose test duration. Youcan either specify exact time for the test or set thetotal number of virtual user sessions that should beexecuted before test completion. Now lets proceedto Page 4.

    Here you can specify the number of test phasesfor which you want to obtain performance data.Each phase will be represented by a separatecolumn in the report that will be created when thetest is completed. The more columns you specify,the more detailed information you will receive inreport.

    The last page of the Wizard contains someimportant hints on how you should proceed with thedesign of your test.

    The most important part of the work is the creationof profiles for virtual users. Each virtual useremulates the activity of one real user. It worksaccording to its profile that specifies its path throughthe web site and other parameters. Each executionof the profile during the test creates one usersession. As soon as it is finished, the virtual userstarts new session and so on until the test iscompleted.

  • 3Preparing to record virtualuser profilesInitially profiles are created by recording youractivity in the special embedded browser windowinside WAPT. You should perform step by step allthe actions of the typical site user while WAPTrecords all HTTP requests initiated by these actions.When the profile is executed during the test, thesame sequence of requests is sent to the server.

    By creating several profiles with different pathsthrough the site, you can emulate different types ofusers in the same test.

    After finishing the Wizard WAPT will show the"Select a Profile for Recording" dialog. You canalso open it by clicking the "Rec" button on thetoolbar.

    If you already have a profile, you can select itand append the recorded requests. In our case weshould create a new profile. You can enter its namein the edit field.

    It is recommended that you delete your InternetExplorer temporary files and cookies beforerecording. This is needed to simulate all requestsfrom a "clean" system of a user who has nevervisited the site before. WAPT can do thisautomatically if you select the correspondingoptions on the Recorder tab of the programsettings.

  • 4Recording the sequence ofrequests

    Type the first URL to be recorded into theprogram address bar and press Enter. As younavigate through your web site inside the browserwindow, WAPT will record all your steps andtransform them into the sequence of HTTP requeststhat are sent to the server. When you later executeyour test, each virtual user will repeat the samesteps by producing the same or similar requests.

    WAPT can intercept all HTTP requests generatedby the embedded browser, even if they are createdinside JavaScript and AJAX code.

    When you finish creating the desired sequenceof requests, click the "Stop Rec" button on thetoolbar to exit the recording mode.

    Now you can edit the parameters of anyrequest by selecting it in the left pane. You can alsodrag and drop requests with the mouse to set themin the desired order.

  • 5Properties of a request andits parameterization

    Select a recorded request in the left view. Theright view will contain two tabs. The "Properties"tab is where you can edit the properties of theselected request.

    The most important property is the set ofparameters that will be passed to the server insidethe request. The parameters are present in requeststhat work with dynamic content. They carry to theserver various data that may be different fordifferent user sessions.

    All these parameters are listed on this page. Initiallythey are recorded as static values. That is why afterrecording you will need to replace those staticvalues with dynamic values calculated with help ofspecial WAPT functions and JavaScripts. As aresult different values of parameters can beproduced for each virtual user and even eachsession. In some cases you will need to extract thevalues of some parameters from the serverresponse to the previous request. WAPT has anumber of functions for this purpose.

    To edit any parameter select it in the list and clickthe "Edit" button. In the "Edit parameter" dialogbox you can specify how to calculate the value.

    Click on the "Response processing" tab to see itscontent.

  • 6Variables and the processingof server response

    The "Response processing" tab is where youspecify how to process the web site response to theselected request. This includes two important tasks:assignment of variables and response validation.

    Variables are used to store string values within usersession. You can add as many variables as youneed in the processing of response to any request.The value assigned to a variable is valid until theend of the current user session or until it isreassigned during the processing of anotherrequest.

    The assignment of variables is very similar to thecalculation of request parameters. You can usesame set of functions for this purpose. Thedifference is that variables are updated afterreceiving server response, whereas parameters arecalculated before sending the request.

    Usually a value is extracted from the response andassigned to a variable. After that the variable isused as a parameter in subsequent requests.

    You can validate response by specifying criteriathat must be met in order to treat it valid. OtherwiseWAPT will produce an error that will be shown in thereport and logs. You can validate by response timeand page content.

  • 7Automatic parameterizationEach web site requires specific efforts toparameterize virtual user profiles correctly, so thatthe sequence of requests specified in each profilewould constitute a valid user session performing thedesired actions on the web site.

    The proper parameterization of requests can be acomplex task. Fortunately WAPT can do some partof this work automatically.

    Click the "Settings" button on the toolbar andswitch to the "Parameterization" tab.

    WAPT can check all web site responsesreceived during recording for dynamic valueslocated between specified left and right boundaries.When such value is found, WAPT creates a variablefor it. During the test the variable will be assigned avalue extracted from the actual response usingsame rules. WAPT will also replace that value in theparameters of all subsequent requests, so that itwould be taken from the variable.

    The "Extract to variables values of hidden fieldsin HTML forms" option works the same way. WAPTwill create a variable for each hidden field.

  • 8Properties of a user profile

    After recording requests you can edit otheroptions of your virtual user profile. Select the profilein the left view and click the "Properties" tab in theright view.

    Here you can modify a number of options, suchas User think time (the time between sendingsubsequent requests), "Load page elements",Keep alive server connection, etc.

    If your web site requires Basic or IntegratedWindows Authentication (NTLM), you can providethe list of username/password pairs that will beused one by one to login virtual users of this profile.If you provide only one username and onepassword, all users of this profile will share them.

    Note that some options (User think time, HTTPheaders and Response validation rules) can bespecified either on the profile level or for eachrequest separately.

  • 9Test verificationIt is recommended to validate your profiles beforerunning the test. This is useful to make sure that allprofiles are parameterized correctly.

    Click the "Verify Test" button on the toolbar tostart verification and choose profiles that should beverified. WAPT will execute all selected profiles onetime producing one user session for each profile.

    Wait until the verification is finished. WAPT willshow a simple report that contains summaryinformation about errors occurred during theexecution of your profiles.

    The "Logs" folder in the left view will becomeexpandable. It will now contain the detailedinformation about performed test verification. Themost convenient way to track down all errors is tobrowse this folder using the log viewer.

  • 10

    Log viewerLog Viewer provides the detailed representation ofall requests, server responses and errors appearedduring the test run or verification. This information isstructured with the help of a tree view with severallevels of detail: profile, user, session and request.

    Expand the "Logs" folder in the left view andselect a page request. In the upper right view youwill see the log lines containing service messages,main page request and requests for page elements(images, CSS, JavaScript, etc). The main pagerequest is highlighted in green if it was processedwithout errors. Requests completed with errors arehighlighted in red. You can select any line of log andsee the details in the lower part of the pane.

    When browsing logs you can compare requestsand responses saved during the test run withinitially recorded ones. This feature is useful whenyou work on the parameterization of requests,because it shows what data is unique for each usersession.

    You can use an additional toolbar located underthe left view for fast and easy navigation through thelog.

    Note that by default logs are disabled for efficiencyreasons, so if you want to obtain them for a test run,you should enable this feature on the "Log andReport Settings" page.

  • 11

    Test Volume

    Select the "Test Volume" item in the left viewinside the "Scenario" folder. Now in the right viewyou can edit the parameters of the test scenario.

    We have already specified the type of load and testduration options in the Scenario Wizard. If you needto change them, you can do this using this page.For example, you can choose fixed number of usersor periodic load instead of ramp-up.

    You should put checkmarks near the profilesthat will be used in the test. If you use severalprofiles, you can choose how to divide the loadbetween them. For example you can specify 15virtual users for the first profile and 10 for thesecond one. This will result in total 25 simultaneoususers.

    The number of users for each profile is specifiedseparately for the beginning of the test (initial users)and for the end of the test (final users).

    The graph shows the number of virtual users on anytest phase. Users with different profiles are shownwith different colors.

    Now we have finished designing our test, so wecan save it. Click the "Save" button on the toolbarto save your test scenario to a file. All profiles will bealso saved to the separate files in the same folder.To open the same test in the future you will need tokeep all those files.

  • 12

    * Available only in Pro version

    Selecting load agents* andstarting the testWAPT Pro allows you to create test load with thehelp of load agents installed on different computers.The more agents you use, the greater test volumeyou can create. Test execution is managed from theworkplace component and all statistics is gatheredfrom all agents to a single report automatically.

    Select the "Load Agents" item in the left viewinside the "Distributed Test Run" folder.

    Click "Search LAN for available load agents"to search your Local Area Network for computerswith installed agents. If you have agents outsideLAN, you can add them manually using the "Add"button. Since the connection between the workplacecomponent and load agents is done over TCP/IP,agents can be installed remotely, provided that theyare available over the Internet.

    Put checkmarks near agents that you want touse in the test. You should check at least one.

    Click the "Run Test" button on the toolbar tostart your test.

  • 13

    Test resultsYou can start monitoring the test results right after youlaunch the test. You may only need to wait severalseconds for the first statistical information to come.

    The results are represented in the form of SummaryReport, Summary Graphs and graphs for each userprofile and single request. You can select the desiredoption in the left view.

    The most important parameters that you can find in theresults are described below.

    Error rate - the number of page requests or usersessions completed with errors as a percentage of totalnumber of requests or sessions. Errors can be eitherreported by the server or detected as a result of networkproblems, wrong server response and timeouts.

    Response time - time required by your web site toprovide a correct reply to a single page request. It canbe measured together with the time required todownload all page elements or without it.

    Number of pages per second - number of pagerequests successfully served by your web site persecond.

    To estimate the performance and reliability of your website you should analyze how the above values changeduring the test depending on the test load.

    You can save the results of the test run either as asingle report in the HTML format, or as a special .wprfile. In the latter case you can open that file with WAPTagain.

  • 14

    * Available only in Pro version

    The use of JavaScript*You can include the execution of a JavaScript codeinto virtual user profiles. This provides you with auniversal way to perform any specific and complexcalculations required to set the correct values ofrequest parameters.

    Select a request after which you want to executea JavaScript. Choose "Add | JavaScript" on thetoolbar. The JavaScript operator will be added to theprofile. Select it to edit the code in the right view.Initially the edit field contains a comment with a shortinstruction on how to use this feature.

    In your code you can use functions defined in theWAPT Pro JavaScript library. Click the "JavaScriptLibrary" button to extend it by adding more .js files.

    Click the "Check Syntax" button to check thesyntax of your JavaScript code. The result of thecheck will be displayed in the Output window.

    There is another way to use JavaScript in yourprofiles. You can call functions defined in theJavaScript library directly when you specify how tocalculate values for request parameters andvariables. You can do this in the properties of anyrequest same way you use other internal WAPT Profunctions.

  • 15

    * Available only in Pro version

    Performance counters*In addition to the external performance parameters,such as response time, WAPT Pro can collectperformance data directly from the server that youtest. This data is included in separate tables in thereport along with other parameters.

    Select the "Performance Counters" folder inthe left view.

    Now in the right view you can add one orseveral servers that are used to run your web site.WAPT Pro will connect to those servers and collectCPU, disk space, memory and network usage dataduring the test. You can choose between using WMIand SNMP interface for each server. Select one thatis supported by each system and specify otherconnection options.

    You can also add one or several databaseservers to read the performance data. You shouldspecify ODBC connection options and select thecounters that you want to monitor. WAPT Proincludes a set of predefined counters for MS SQLand Oracle databases, but you can add your ownones that will read any specific parameters. Foreach counter you should specify SQL query that isused to retrieve it from the database.