O'Reilly logo

Selenium Testing Tools Cookbook by Unmesh Gundecha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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:

  1. Click on Local.testsettings ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required