Creating a data-driven test in MSTEST
To create a data-driven test in MSTEST, the unit testing framework provided by Microsoft Visual Studio is the simplest way to parameterize the test scripts with .NET bindings.
MSTEST has in-built features to support data-driven testing, which can be configured very easily. In this recipe, we will use MSTEST to create a data-driven Selenium test by reading test data from an Excel spreadsheet.
Getting ready
Create a new C# test project in Microsoft Visual Studio 2010 and name it
BMICalculator
Add a reference to the WebDriver .NET binding
How to do it...
You can parameterize a test in MSTEST by adding the Excel spreadsheet to deployment items of the test project, using the following steps:
Click on Local.testsettings under Solution Items, as shown in the following screenshot:
The Test Settings dialog will appear. We need to add the test data file by clicking the Add File button in the Deployment section, as shown in the following screenshot:
Once you add the file...