How to: Add an XML File Data Source to a Web Test
Before you can add data binding to a Web request, you must add a data source to the Web test. After you add a data source to a Web test, you can bind a Web request to the data. For more information, see How to: Add Data Binding to a Web Request. After you add data binding to a Web request, you must configure the test run to access one or more rows of data. For more information, see How to: Configure Data Binding in a Web Test.
To add the data source to the Web test
In the Web Test Editor, right-click the top node of the Web test and then click Add Data Source.
The New Test Data Source Wizard appears.
In the Data source name box, type a name for your data source.
In the Data source type list, click XML File.
In the Choose an XML file box, type the path and name of the file, or click the ellipsis to browse to the file. For example, enter the following:
In the Table drop-down box, select a table.
The data from the XML file appears in the Preview data pane. The first 1,000 rows of data are displayed.
Under Choose from the available tables for this data source, select the check box next to the table you want.
A dialog box appears that asks you if you want to add the file to your current project. You can use the following information to help you decide:
The file is copied to the project.
When the project is deployed, there is no extra work that is required.
The file is not copied to the project. When the project is deployed, you might have to update the path of the file.
Some data files can be very large, and should be maintained separate from the project. Some data files must be shared among several members of a team, and should be maintained in a central location that all members can access.
Click Yes or No.
A Data Sources node will be added to the Web test, and the text file will appear as a table in the hierarchy.
On the File menu, click Save to save the Web test.