07.11.2014 Views

Enterprise Library Test Guide - Willy .Net

Enterprise Library Test Guide - Willy .Net

Enterprise Library Test Guide - Willy .Net

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

176<br />

<strong>Enterprise</strong> <strong>Library</strong> <strong>Test</strong> <strong>Guide</strong><br />

Creating a Web <strong>Test</strong> Script<br />

A Web test script simulates how an application might interact with an application<br />

block. Typically, you create a test script by recording HTTP requests using the Web<br />

<strong>Test</strong> Recorder in a browser session.<br />

The following procedures generate a test script in Visual Studio 2005 Team Edition<br />

for Software <strong>Test</strong>ers.<br />

<br />

<br />

To create a test project<br />

1. Open Visual Studio Team Edition for <strong>Test</strong>ers<br />

2. Create a test project. Click File, point to New and click Visual C# <strong>Test</strong>.<br />

3. Type a name and click OK.<br />

After you have created a test project you can record a Web test.<br />

To record a Web test<br />

1. If the test project is not open, open it. On the File menu, point to New, and then<br />

click the test project.<br />

2. On the <strong>Test</strong> menu, click New <strong>Test</strong>. The Add New <strong>Test</strong> dialog box appears.<br />

3. Click Web <strong>Test</strong>.<br />

4. In the <strong>Test</strong> Name box, type a name. Do not use the .webtest extension. Click OK.<br />

The Web <strong>Test</strong> Recorder opens inside a new instance of Internet Explorer.<br />

5. Enter the URL of the Web site you want to test.<br />

6. Execute the actions the test will simulate by clicking the appropriate controls, such<br />

as buttons and drop-down list boxes.<br />

7. Click Stop to stop recording.<br />

8. On the File menu, click Save to save the test.<br />

Repeat this procedure for each test that is contained in the test harness.<br />

The tree of nodes that contains URLs in the Web <strong>Test</strong> Editor is named the request tree.<br />

You can select nodes in the request tree to view the properties associated with each<br />

request after the test is recorded. Figure 3 is an example of a request tree.<br />

Figure 3 Request tree

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!