Getting Started Webking40
Getting Started Webking40
Getting Started Webking40
Introduction
Welcome to WebKing, a comprehensive Web verification tool that automates the most critical Web verification practices: static analysis, functional/regression testing, and load testing. WebKing's automated technologies help you verify application functionality, accessibility, and performance without writing a single script, plus its flexibility allows you to automatically verify even the most specialized requirements. Wizards guide you through required steps, and unique technologiespaired with preconfigured test scenariosallow you to begin complex tests with no setup. Moreover, WebKing helps you automate specialized tests by providing easy ways to dynamically populate forms with data source values, design and replay complex test sequences, and design custom tools and tests. You can start testing instantly, then easily extend and customize tests if needed. By helping you automate key testing practices as rapidly and easily as possible, WebKing ensures that thorough testing does not drain available resources or delay your intended release. In fact, consistent use of WebKing often reduces the time to deployment and frees your time for more complex and interesting tasks than functionality verification.
Installing WebKing
Log in to Windows using an account with Administrator privileges before you install WebKing. To install WebKing on a Windows machine: 1. Run the installation file that you downloaded or that is on your CD. 2. Follow the on-screen installation directions.
Starting WebKing
After installation is complete, you can start WebKing by choosing Start> Programs> WebKing 4.0> WebKing or double-clicking the WebKing desktop icon. Before you start using WebKing, you must install a license.
Installing a License
If your organization does not use Parasoft LicenseServer to manage Parasoft licenses: 1. Launch WebKing by choosing Start> Programs> WebKing 4.0> WebKing. 2. Open the Password window in one of the following ways: If you see a dialog box asking if you would like to install a password, click Yes. If you do not see this dialog box, choose File> View Password.
3. Contact your Parasoft representative to get your license. 4. In the top portion of the Password tab, enter your expiration date and password. 5. Click OK to set and save your license. If your organization uses Parasoft LicenseServer to manage Parasoft licenses: 1. Launch WebKing by choosing Start> Programs> WebKing 4.0> WebKing. 2. Open the Password window in one of the following ways: If you see a dialog box asking if you would like to install a password, click Yes. If you do not see this dialog box, choose File> View Password.
3. In the lower portion of the Password tab, select the Use LicenseServer option. 4. Enter your LicenseServer Host name in the Host field. 5. Enter your LicenseServer port number in the Port field (the default port is 2002). 6. Click OK to set and save your LicenseServer information.
7. Contact your Parasoft representative to get your license. 8. Add your license to LicenseServer as described in the LicenseServer documentation.
Installing WebKing
To install WebKing on a UNIX machine: 1. If you havent already done so, move the installation file that you downloaded to the directory where you want to install WebKing (typically /usr/local). 2. Change directories to the directory where you are going to install WebKing (typically /usr/ local). 3. Extract the necessary files by entering the following command at the prompt:
tar -xvzf WebKing40_UNIX.tar.gz
After you enter this command, a directory named webking/4.0 is created within your current directory, then all WebKing files are extracted into this directory. 4. Edit the webking script to indicate the correct paths to your Java installation and your WebKing installation. This script (webking) is typically located in /usr/local/webking/4.0/ The WEBKING variable should be set to the directory that contains the script you are currently editing. If your environment does not have a $JAVA_HOME variable, you need to add it to the script. To do this, add the following line before the line containing the JRE variable:
JAVA_HOME=<path to JDK(typically /usr/local/jdk/)> ; export JAVA_HOME
For example,
JAVA_HOME=/usr/local/jdk/ ; export JAVA_HOME
Starting WebKing
To run WebKing: 1. Change directories to the webking/4.0 directory. 2. Enter the following command at the prompt:
webking
Installing a License
If your organization does not use Parasoft LicenseServer to manage Parasoft licenses: 1. Launch WebKing. 2. Open the Password window in one of the following ways: If you see a dialog box asking if you would like to install a password, click Yes. If you do not see this dialog box, choose File> View Password.
4. In the top portion of the Password tab, enter your expiration date and password. 5. Click OK to set and save your license. If your organization uses Parasoft LicenseServer to manage Parasoft licenses: 1. Launch WebKing. 2. Open the Password window in one of the following ways: If you see a dialog box asking if you would like to install a password, click Yes. If you do not see this dialog box, choose File> View Password.
3. In the lower portion of the Password tab, select the Use LicenseServer option. 4. Enter your LicenseServer Host name in the Host field. 5. Enter your LicenseServer port number in the Port field (the default port is 2002). 6. Click OK to set and save your LicenseServer information. 7. Call 1-888-305-0041 to get your license. 8. Add your license to LicenseServer as described in the LicenseServer documentation.
Menu Bar
Toolbar
Right Panel
Left Panel
Messages Panel
Status Bar
Menu Bar
The menu bar contains commands for performing key WebKing operations; for example, it allows you to create and manage projects (projects contain all the test settings for a site or related set of sites), create and manage tests, apply and customize tools, change active windows, edit files, etc. The menu bar is dynamic; in other words, it contains different commands depending on what task you are performing in the right and left panels.
Toolbar
The toolbar contains buttons which allow you to access the most commonly-used WebKing commands. Most toolbar buttons invoke wizards which guide you through any steps required to complete the related action. For example, if you click the Load Test button before you have created a project or customized
any load test scenarios, the wizard will guide you through the process of creating a project and choosing one of the default load testing scenarios, then start the load test using the newly-created project and the designated scenario. The toolbar also contains a File/URL Entry field. If you want to quickly apply a tool to a single file or page that is not represented in a WebKing project, you enter the appropriate URL or file path in this field, then run the tool. The tool bar is customizable.
Left Panel
The left panel contains the tabs that let you view, customize, and select project items such as files, paths, load tests, and test suites. These items are grouped into the Project tab, Paths tab, Load Tests tab, Test Suite tab, and File tab. Each tab represents its contents in a tree structure. WebKing will not display a tab until you have activated it (for example, by performing an operation that adds content to the tab or by choosing a menu item that opens the tab with default settings). Generally, if you want to customize settings for an item available in a tree, you either click that item or right-click it then choose the appropriate shortcut menu item. The item selected in the tree typically determines the scope or target of any tool that you run. For example, if you select a specific directory in the Project tree then click the Static Analysis toolbar button, WebKing will perform static analysis on the selected directory. If you select the Steady Load scenario in the Load Tests tab then click the Load Test toolbar button, WebKing will start load testing the current project by simulating a steady load of users.
Right Panel
The right panel displays windows related to the current action you are performing (for example, test configuration and file editing). After you run a tool, the results from that tool are sent to a results window in this panel. All windows remain available until you close them or you close the WebKing GUI. Only one window can be active at any given time. You can activate a hidden window by choosing Window> [name of window]. Alternatively, you can choose Window> Windows, then select the window name from a dialog box that lists all available windows. Each different type of window provides a number of shortcut menu commands that help you perform the task at hand. For example, results windows contain shortcut menu commands that help you explore, interpret, and correct reported errors. Editor windows contain shortcut menu commands that invoke typical editor commands (such as copy, cut, paste, undo, search, etc.).
Messages Panel
The Messages panel reports messages regarding project loading progress, test progress, test summaries, and test execution problems. You can save, copy, e-mail, and clear the contents of this panel by right-clicking the panel, then choosing one of the available shortcut menu commands.
Status Bar
The status bar displays progress, alert, and error messages. The status bar is also used to indicate a projects current source and deployment target. Icons to the left of the arrow indicate source properties; icons to the right of the arrow indicate deployment target properties. You can change targets by clicking the target icons. You can publish the site by right-clicking the arrow, then choosing Publish from the shortcut menu.
Using WebKing
The following exercises provide a quick introduction to WebKings three core features: static analysis, functional testing, and load testing.
3. (Optional) If accessing certain pages (for example, log out pages) might prevent WebKing from loading the site correctly and/or completely, prompt WebKing to avoid this pages by indicating that they are restricted URLs; see Preparing WebKing to Avoid Restricted URLs on page 9 for instructions. 4. Click OK to prompt WebKing to create a new project and start loading the specified site. As WebKing loads your site, it spiders through static and dynamic pages and loads at least one instance of each page it encounters. If your site contains forms, WebKing allows you to populate forms using form input dialog boxes. If WebKing opens form input dialog boxes as it loads your site, complete them as described in Populating Forms During Loading on page 9. If WebKing reaches an external URL (a URL outside of your current site) while loading a site, WebKing opens a Create New Site dialog box that asks you whether you want to create a new site (within the current project) for that URL and related pages. For details about this dialog box, see Managing External URLs During Loading on page 10.
When WebKing is done loading your site(s), it represents site files and directories hierarchy in the Project tree. For details about the Project tree, see the WebKing Users Guide.
Perform this action... Enter a new name in the Form Test Name field.
Perform this action... 1. Use the Configure Form Input controls to add or modify inputs for each form input element. If you do not add an input for a specific element, the default input (as specified in the code) will be submitted. 2. (Optional) Change the default form submission method. To mimic a simple JavaScript submission or a situation where the user submits the form by pressing the Enter key, select the Implied Submit option. To mimic the user submitting the form by clicking a submit button, either choose the option representing that submit button (for example, Image: "Anonymous" or click a specific area of the submit image (if available in the Form Input panel).
3. Click Add when you are ready to add the input. After you add an input, WebKing reopens the same form dialog box so you can enter additional inputs. Indicate that you do not want to enter any more inputs for the current form. Indicate that you do not want to enter any more inputs for the current form or any other instances of this form. Indicate that you do not want to enter any more inputs for forms in this site. Browse the page related to the current form. Click Skip. Click Skip Form.
10
To do this... Current: Prompt WebKing to create an entirely new site (using your current Web server load settings) and add that site to your Project tree. Future: Prompt WebKing to automatically create a new site and load the related pages every subsequent time it encounters an external URL in the current project. Current: Prompt WebKing to create an entirely new site (using your current Web server load settings) and add that site to your Project tree. Future: Prompt WebKing to display this dialog box any subsequent time it encounters an external URL in the current project. Current: Prompt WebKing to open a dialog box that allows you to indicate the site (from the current project) for which this URL is an alias. (An alias is a domain that you want WebKing to consider equivalent to the domain of one of the sites in your project. For example, http:// www.parasoft.com might have the aliases parasoft.com and www.parasoft.com). Future: Prompt WebKing to display this dialog box any subsequent time it encounters an external URL in the current project.
Use these settings... Add as alias of an existing site: Clear Do not show this dialog: Checked Yes or No button: Yes button
Add as alias of an existing site: Clear Do not show this dialog: Clear Yes or No button: Yes button
Add as alias of an existing site: Checked Do not show this dialog: Unavailable Yes or No button: Yes button
11
To do this... Current: Prevent WebKing from creating a new site or loading pages from the referenced external URL. Prevent WebKing from accessing the external URL and add the external site to the list of project-level restricted URLs. Future: Prevent WebKing from opening this dialog box, creating a new site, and loading related pages any subsequent time that it encounters an external URL in the current project. Current: Prevent WebKing from creating a new site or loading pages from the referenced external URL. Prevent WebKing from accessing the external URL and add the external site to the list of project-level restricted URLs. Future: Prompt WebKing to display this dialog box any subsequent time it encounters an external URL in the current project.
Use these settings... Add as alias of an existing site: Clear Do not show this dialog: Checked Yes or No button: No button
Add as alias of an existing site: Clear Do not show this dialog: Clear Yes or No button: No button
Enter a valid username and password in the appropriate fields, specify whether you want WebKing to save the password in its project file, then click OK. Warning: By default, any password you enter in one of these dialog boxes will be saved and stored in your project file; this way, you only need to enter passwords once. If you consider your project file to be insecure, we recommend that you do not save these passwords. To prevent WebKing from saving these passwords, disable the Save password check box at the bottom of the Connection Password dialog box in which you enter the password. For information on viewing and modifying authentication password information, see the WebKing Users Guide.
12
In addition, static analysis can verify unique requirements that your team wants to check. For example, if your team needs to follow custom coding rules, project-specific design requirements, and projectspecific content requirements, you can automatically generate a rule that verifies whether each requirement is satisfied, and then check compliance during static analysis.
Procedure
To perform static analysis on the project you created in Exercise 1: Click the Static Analysis toolbar button. WebKing will then analyze the projects files and report errors in the right panel. For instructions on exploring static analysis errors, see the WebKing Users Guide.
Additional Options
You can customize static analysis tests by: Enabling or disabling any of the built-in tools available for static analysis. Customizing the parameters of any tool applied during static analysis. Designing tools that verify compliance with unique team or project requirements, then configuring WebKing to apply those tools during static analysis. Running static analysis on selected files or directories. Running static analysis on the click paths you record and generate for functional testing. Configuring WebKing to suppress error messages that are not relevant to your project.
For details about these options, see the WebKing Users Guide.
13
While static analysis finds problems by inspecting pages source code, functional testing finds problems by simulating how click paths would operate in a browser. WebKing facilitates functional testing by providing easy ways to generate and record test click paths without any scripting. To run your initial test, you click the Test Functionality button, and then use the Path Creation wizard to create the initial paths. This wizard allows you to automatically generate paths or record specific paths by clicking through the application in a special path creator browser. WebKing then executes the initial paths and reports errors if it cannot execute one of the recorded path items or if a runtime error occurs while executing the path. You can then extend this initial set of test paths in a number of ways: Automatically record your applications most popular click paths by prompting WebKing to analyze your server log files. Use the Path Creation wizard to automatically generate a variety of unique paths and/or to help you record specific click paths that correspond to your specification and use cases.
By combining these options, you can quickly represent your most critical and popular paths as well as an array of other potential paths that might otherwise go untested. Any or all of these paths can be verified with one click of the Test Functionality button. Once you have verified that one or more paths work correctly, you can automatically record path execution results to establish baseline regression controls. After these regression controls are established, WebKing compares all subsequent path execution results to the baseline results, and then reports unexpected path flow and content changes. WebKing performs regression testing at the code level, so it exposes subtle changes that are not detectable at the GUI level (for example, minor changes to scripts or hidden form options). Moreover, it reports the differences both textually and graphically to help you quickly pinpoint and understand any unexpected changes that occur. In addition, you can increase the scope and comprehensiveness of your functional testing by dynamically populating forms with values stored in a data source. After you tell WebKing how you want a paths forms populated with data source values, WebKing will dynamically populate the designated forms every time it accesses that path. In addition, if you configure a test suite that exercises the path, WebKing will automatically populate and execute that path one time for every available combination of data source rows. Consequently, if the paths forms use values from a single data source, that path is executed one time for every row in the data source. If the paths forms use values from multiple data
14
sources, that path is executed and tested one time for every possible combination of rows. As a result, you can create and test a large number of path instances with a single click of a button.
Procedures
Running the Initial Test
To perform an initial functional test on the project you created in Exercise 1: 1. Click the Test Functionality toolbar button. 2. Use the Path Creation Wizard to record or generate the initial click paths that you want WebKing to test. Consider the following points when completing this dialog box: All path creation will begin from the URL listed at the top of the dialog box. To start path creation from a different URL, enter or select the preferred URL. If you only want to test one page (the page listed at the top of the dialog box), leave the Add initial page only option selected. If you want to record the initial path by clicking links and submitting forms in a browser, select the Expand using browser option (only available on Windows systems). If the Web server for this site does not allow multiple simultaneous log ins from the same user, clear the Paths allow multiple sessions check box. If you want WebKing to automatically create new paths through your site, select the Automatically create unique paths option. By default, WebKing will create paths no longer than 3 steps deep; to change the maximum path depth, enter or select the desired option in the Depth box.
WebKing will then create paths (or help you record them in a browser), perform functional testing on the paths, then report functionality errors in the right panel. For instructions on exploring functionality errors, see the WebKing Users Guide.
15
2. Choose Update Regression Controls from the shortcut menu. WebKing will then execute all paths in the Paths tree and record a regression control for each path page. Each regression control stores the code that was delivered to the client browser after the previous path steps were executed. WebKing will display a filled gray bubble to the left of any page that contains a control. Note that you can only add controls to Paths tree nodes that produce viewable and testable pages. If it does not make sense to add a regression control to a particular node, WebKing mark that node with an empty regression status indicator. To prompt WebKing to perform regression testing as well as its core functional testing: Click the Test Functionality toolbar button. After a test has completed, WebKing will communicate regression results using both Paths tree regression bubbles and regression error results messages.There are two ways to access details about a regression detected: Double-click the related result message. Right-click a Paths tree node with a red regression bubble, then choose Regression Results from the shortcut menu.
For instructions on exploring regression errors reported, see the WebKing Users Guide.
Additional Options
You can customize functional tests by: Populating forms with values stored in a data source. Recording and generating additional paths via the Path Creation wizard and GUI controls. Generating your sites most common paths by prompting WebKing to analyze your server log files. Extending the existing paths via JavaScript. Configuring WebKing to run a script or tool every time it accesses a designated path step (for example, to perform initialization, set or remove a cookie, etc.).
For details about these options, see the WebKing Users Guide.
16
Procedure
To perform an initial load test on the project you created in Exercise 1: 1. Click the Load Test toolbar button. 2. In the Confirm Scenario Wizard, indicate what scenario you want to use. Consider the following points when completing this dialog box: The Bell scenario simulates the typical daily user distribution (starts at the lowest point immediately after midnight, rises gradually in the morning, peaks towards the middle of the day, declines gradually in the afternoon, then returns to the lowest point at the end of the day). This is useful for expected usage testing, which determines how the site handles normal load patterns. The Buffer Test scenario simulates a variable load over time. This helps you determine whether resources are released when the load decreases. It also helps you determine whether overall performance degrades over time. The Linear Increase scenario simulates a load that increases linearly over time. This is useful for stress.capacity testing, which helps you determine how many users your application can support.
17
The Steady Load scenario simulates a steady load of users over time. This is useful for endurance testing, which helps you determine whether performance degrades over time.
WebKing will then run a load test based on the specified scenario settings as well as the related virtual user profile settings and machine settings. Since you have not customized the settings, WebKing will run the test on the local machine and create virtual users that create unique paths through the application. Results are reported in a variety of customizable formats. When the test completes, WebKing will show a test summary in the right panel. To access results in bar graph, text format, or histogram format, choose the appropriate command from the Views box. These results can be sorted, filtered, and customized. For details about the different types of results available and how to customize them, see the WebKing Users Guide.
Additional Options
You can customize load tests by: Prompting WebKing to automatically generate a custom load test scenario that simulates your application's actual load distributions and your users' actual path choices (based on log file analysis). Customizing the paths virtual users follow during the test (virtual users can follow specific paths recorded or generated for functional testing, or they can automatically create original paths through the application). Customizing the tools virtual users apply to verify functionality under load. Customizing virtual user browsing characteristics such as delay between clicks, types of links followed, cookie use, etc. Configuring WebKing to perform stress testing by running tests from multiple server machines located at different locations within and without the network. Customizing the number and distribution of virtual users over time and over machines. Customizing the type and distribution of path combinations over time and over machines. Customizing the test duration. Designing a filter that focuses results on the details most important to you.
For details about these options, see the WebKing Users Guide.
18
Saving a Project
To save the current project and all related settings, perform one of the following actions: Click the Save Project toolbar button. Choose File> Save Project. Choose File> Save Project As.
Opening a Project
To open a project file: Click the Open Project toolbar button. Choose File> Open. Choose File> Recent Files> Projects> [name_of_project_file] (this option is only available when you are opening one of the six most recently accessed project files).
Tip: We recommend that you press the F5 key to refresh the Project tree after restoring a project file. This way, you know that your Project tree reflects the most current source contents and structure.
Learning More
This guide provides a quick introduction to WebKings three core features: static analysis, functional testing, and load testing. However, you can use WebKing to perform a wide variety of tests, analyses, and transformations. To learn more about additional WebKing tools and customization options, see the WebKing User's Guide. You can access the WebKing User's Guide by choosing Help> Online Documentation in the WebKing GUI, or by pressing the F1 key when the WebKing GUI is open.
19
20
21