Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Selenium Testing Tools Cookbook Second Edition

You're reading from   Selenium Testing Tools Cookbook Second Edition Over 90 recipes to help you build and run automated tests for your web applications with Selenium WebDriver

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781784392512
Length 374 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
UNMESH GUNDECHA UNMESH GUNDECHA
Author Profile Icon UNMESH GUNDECHA
UNMESH GUNDECHA
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Getting Started 2. Finding Elements FREE CHAPTER 3. Working with Elements 4. Working with Selenium API 5. Synchronizing Tests 6. Working with Alerts, Frames, and Windows 7. Data-Driven Testing 8. Using the Page Object Model 9. Extending Selenium 10. Testing HTML5 Web Applications 11. Behavior-Driven Development 12. Integration with Other Tools 13. Cross-Browser Testing 14. Testing Applications on Mobile Browsers Index

Configuring Microsoft Visual Studio for Selenium WebDriver test development

Selenium WebDriver provides .NET bindings to develop Selenium tests with the .NET platform. To use the Selenium WebDriver API along with .NET, you need to refer the Selenium WebDriver libraries to the project. Microsoft Visual Studio being the major IDE used in the .NET world, setting up the Selenium WebDriver support has become easier with NuGet Package Manager (http://nuget.org/).

This recipe explains the process of setting up Selenium WebDriver in Microsoft Visual Studio 2013 using NuGet.

Getting ready

NuGet comes bundled with Microsoft Visual Studio 2012 onwards. However, for Microsoft Visual Studio 2010, you will need to download and install NuGet from http://nuget.codeplex.com.

How to do it...

Let's configure Microsoft Visual Studio 2013 to develop Selenium WebDriver tests using the following steps:

  1. Launch the Microsoft Visual Studio.
  2. Create a new project by selecting File | New | Project from the main menu.
  3. In the New Project dialog box, select Visual C# | Test | Unit Test Project. Name the project as SeleniumCookbook and click on the OK button, as shown in the following screenshot:
    How to do it...
  4. Next, add Selenium WebDriver packages using NuGet. Right-click on the SeleniumCookbook solution in Solution Explorer and select Manage NuGet Packages…, as shown in the following screenshot:
    How to do it...
  5. On the SeleniumCookbook - Manage NuGet Packages dialog box, select Online and search for the WebDriver package. The search will result in the suggestions shown in the following screenshot:
    How to do it...
  6. Select Selenium WebDriver from the list and click on the Install button. Repeat this step for Selenium WebDriver Support Classes. Successful installation will show a green tick mark for both the packages, as shown in the following screenshot:
    How to do it...
  7. Close the SeleniumCookbook - Manage NuGet Packages dialog box.
  8. Expand the References tree for the SeleniumCookbook solution in Solution Explorer. References for WebDriver are added to the project as shown in the following screenshot:
    How to do it...
  9. The SeleniumCookbook project is ready for test development. You can go on adding new tests as needed.

How it works...

NuGet Package Manager adds the external dependencies to Microsoft Visual Studio projects. It lists all available packages and automatically downloads and configures packages to the project. It also installs dependencies for the selected packages automatically. This saves a lot of effort in configuring the projects initially.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image