UI Automation With C# and Selenium: Adding Packages

The Takeaway: Installing the right packages from the start makes everything else a lost easier.

So far, we’ve created a blank solution with a few projects and added that solution to a repository. Now we need to install the right packages so that when we start coding some tests, everything will be in place and we won’t need to go back and figure out what we’re missing. For our automation, we’ll start out with the following packages:

  • Selenium
  • NUnit
  1. In your automation solution (which you can find the previous post for here), Navigate to Tools > NuGet Package Manager > Manage NuGet Packages for Solution

    Visual Studio - Manage NuGet Packages
    Visual Studio – Manage NuGet Packages
  2. Select the Browse option and search for Selenium 

    Visual Studio - Selenium NuGet Packages
    Visual Studio – Selenium NuGet Packages
  3. For each package Selenium. WebDriver and Selenium.Support, select the package. Notice that the project where our tests live is the only option available installing this package. Remember, since the framework is a Shared Project, there’s no DLL file created for that project, but the files required for the tests will be automatically included when the test project is built 

    Visual Studio - Packages Install in the Test Project
    Visual Studio – Packages Install in the Test Project
  4. Select the Test project (UI Tests in the example above) and select the Install Button 

    Visual Studio - Installing Packages
    Visual Studio – Installing Packages
  5. You’ll probably need to confirm the install of each package as well 

    Visual Studio - Review Package Install
    Visual Studio – Review Package Install
  6. After both the Selenium.WebDriver and Selenium.Support packages are installed, search for and install the NUnit and NUnit .Console packages as well 
    Visual Studio - Installing Nunit Packages
    Visual Studio – Installing NUnit Packages

    Once the NUnit packages are installed, you can select the Installed link and see that several NUnitpackagaes were installed. These packages will be the basis for our framework and tests, but we’ll add more as we progress.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.