Testing sites in MS Visual Studio 2005


Before you proceed directly to the description available in Visual Studio Team System test types, let me remind you that there are two main ways to test: manual and automated. With manual testing, testers tend to operate on a pre-made program, protokoliruya their actions and results. Set of checks is constantly expanding and re-run performance in the development and testing.

In the case of automated testing checks are done automatically, possibly on the schedule. The results are recorded and shown in a conventional tester also automatically. The human factor in this case is weakened. However, writing the script (the script) testing often takes longer than doing the appropriate checks by hand, even taking into account the frequency and time for training testers.

Thus, the choice of the degree of automation is a highly nontrivial task, which is solved for each project separately. Also, be aware that some problems in principle can not be automated, such as usability testing interface (usability), or to hand, such as stress testing.

In Visual Studio Team System is a tool for testing both ways: manually and automatically. Also given an opportunity of entry of test results into the database, charting, recording and analysis of errors found, etc.

In this article we will use Visual Studio tools for testing only, namely, functional testing sites – Web tests (web tests).

So, to create a test must first create a project testing a (test project). However, it can not create a separate, because the wizard will offer to do this test automatically. In Visual Studio Team System testing a project specifically designed for storing various types of tests. Each testing a project related to the specific language of the supported in Visual Studio (Visual Basic, C #…), on which to write test scripts (test scripts).

To create a new test, you need to select the menu item "Test – New Test …" and in the form that appears select the type of test.

In Visual Studio Team System supports six basic types of tests: unit test, manual test, ordered test, web test, load test, generic test. You can also create your own custom test types.

C Utility Test Manager, you can view the tests that apply to all projects and decisions (solutions), are working with, and manage (copy, delete, edit, etc.).

To test the sites most suitable web test and load test. They are designed to test the functionality, performance and load testing site, respectively.

Let us consider the appointment, establishment and operation of web-based test (web test). A Web test is a series of http-requests. Web tests work at the protocol level. When you run a test engine (web test engine) performs these requests, stores and analyzes the responses from the server (response). When you run the Web test the interaction with the browser does not occur, all the engine tests are run on a lower protocol, level.

The easiest way to create a new Web test – write the sequence of user actions using the browser and Visual Studio Team System. It is also possible to create a Web test by hand.

During the creation of a Web test by recording the user opens a browser (in any case, Internet Explorer, even if your default browser is the other) with an additional window on the left side – Web Test Recoder, which is part of Visual Studio Team Edition for Testers. It displays all the users are in the form of http-requests. In the upper part of the additional windows are buttons to control recording: Record, Pause, Stop, Add a Comment and Clear All Requests.

Record button is pressed by default, that is beginning to be recorded immediately after pressing the button «OK» to the box, create a new test. After entering the address in the address bar a page of the test site in the Web Test Recorder window appears displaying it in the form of http-request.

Stop and Pause buttons are designed to end or stop recording, respectively. As long as you press Pause, you can perform any action on the test site. Thus, at the request of the tester can not record all the action, but only during the execution of which the Pause button is pressed.

By clicking Add a Comment, you can add to the sequence of requests in the Web Test Recorder text comment – quite handy feature when drawing up a Web test larger sizes. With further editing or running a Web test kommentrarii help to understand what is happening at this stage of the test. After all, much easier to understand human text, than the sequence of http-requests.

Also, comments are useful for creating small notes of generated within a Web test validation rules. The appointment and the creation of validation rules will be discussed below.

The button Clear All Requests – far right panel Web Test Recorder – designed for cleaning a web-based test of all the requests that have been saved.

Each request, recorded in the Web Test Recorder, has a set of properties. These properties are displayed on the Properties, which is usually located in the lower right corner of the screen.

A set of properties is quite large queries, consider the details only property ThinkTime. Its value is equal to the amount of time (in seconds) that the user waits before executing the next query (roughly speaking, this time between two clicks). Thus, by using the property ThinkTime can humanize the Web test. If the value is zero ThinkTime, during test execution requests will be sent to the server as quickly as possible.

To verify the site Visual Studio Team System offers tools such as validation rules (validation rules). C using validation rules verified the existence of different elements in the returned page: tags, text, attributes, etc. Also, validation rule can verify that these elements predetermined values, and find out how long it takes to perform each query.

When you create a Web test to a default has to include some validation rules. New rules can be added by clicking on the query, right-clicking and from the context menu Add Validation Rule.

In the case of a more powerful and advanced web-tests simple list of http-requests may be not enough. In this case, the Web test can be written as a script code (coded web test). Thus, the tester to open more opportunities: you can implement the construction of branching, loops …

To view a Web test in the form of the code needed to press the Generate Code button on the toolbar to bookmark a Web test.

After completing the Web test opens a form, which presents the results of a Web test. In its upper part is a tree whose nodes are the requests from the web test. If there are errors in the query its icon changes its appearance. Inside each node is a list of files returned by the server for each request.

At the bottom of test results, there are five tabs: Web Browser, Request, Response, Context and Details. Web Browser tab, you can see what the user sees in the browser window when you run a query, the cursor is on. At the Request and Response tabs are the headers and body of the request and response from the server, respectively. Context tab is stored additional information about the request. The results of the rules are on the tab Details.

So, in Visual Studio Team System, there are quite a powerful tool for organizing testing sites. It is particularly convenient to use them, if development of the site is also using Visual Studio, because all its elements are closely integrated. However, web tests can be useful for testing sites that have been developed in other media, and even to testing sites, whose development has been completed.

Also note that in the field of automated testing Microsoft is still far from such monsters as IBM-Rational, Segue, Automated QA. Because of all the automated testing tools in its arsenal is as yet only means for functional and load testing using a series of http-requests.

See Also

    Advertising

    Archives