How to Configure Selenium using NUnit in Visual Studio

Last updated on Nov 24 2021
Swaminathan M

Table of Contents

How to Configure Selenium using NUnit in Visual Studio

Before writing the test script with the assistance of NUnit, we’ll understand NUnit Framework, downloading and installing the NUnit Framework in Visual Studio

What is NUnit Framework?
• Download the NUnit3 Test Adapter
• Adding the References for NUnit
• Create a NUnit class
• Write Selenium test script using NUnit
• Execute the test script

What is NUnit Framework?

NUnit may be a unit testing framework for all .Net languages. it’s open-source software, and it’s been completely redesigned to require advantage of the many new features .Net language.

It also supports a good range of .Net languages platforms.

Download the NUnit3 Test Adapter

The NUnit3 Test Adapter is an extension that permits us to run the NUnit test inside the Visual Studio.
To download the NUnit3 Test Adapter within the Visual Studio, follow the below steps:
• First, attend the Extensions and choose the Manage Extensions option within the Visual Studio.

nunit 1
Manage Extensions

• The Manage Extensions window will appear on the screen, where we’ll look for NUnit, and click on on the Download button for NUnit 3 Test Adapter as we will see within the below screenshot:

nunit 2
window

• Once we clicked on the Download button, it’ll ask us to shut our Visual Studio to switch the changes, then click on the Modify button as we will see within the below screenshot:

nunit 3
Modify

• Once we clicked on the Modify button, it gets start installing and modifying the NUnit 3 Test Adapter.
• When all the modifications are completed, we got the below window:

nunit 4
window

• As we will see within the Manage Extensions window, the NUnit 3 Test Adapter is successfully installed.

nunit 5
successfully installed

• Once we are through with the NUnit 3 Test Adapter installation process, we’ll add the references for NUnit.

Adding the References for NUnit

To add the reference for NUnit, follow the below process:
• Right-click on the References in Solution Explorer, and choose the Manage NuGet Packages option within the given pop-up menu.

nunit 6
NuGet Packages

• In the Manage NuGet packages window, we’ll look for NUnit within the search field, and choose the primary option as NUnit, and click on on the Install button as we will see within the below screenshot:

nunit 7
choose NUnit

• Once we clicked on the Install button, Preview changes window will appear on the screen where we clicked on the OK

nunit 8
Install button

• Once the package got successfully installed, we’ll get the below output message.

nunit 9
successfully installed

Create NUnit Class

To create a NUnit class within the Visual studio, follow the below process:
• Right-click on the SeleniumTest project, then attend Add and choose Class option from the given pop-up menu.

nunit 10
SeleniumTest

• The Add New Item window will appear on the screen, where we’ll provide the category name as Sample1, and click on on the Add button as we will see within the below screenshot:

nunit 11
Add New

• Once we clicked on the Add button, below window will appear on the screen:

nunit 12
window

• After creating the category successfully, we are able to write our test script using NUnit.

So, this brings us to the end of blog. This Tecklearn ‘How to Configure Selenium using NUnit in Visual Studio’ blog helps you with commonly asked questions if you are looking out for a job in Selenium and Automation Testing. If you wish to learn Selenium and build a career in Automation Testing domain, then check out our interactive, Selenium Certification Training, that comes with 24*7 support to guide you throughout your learning period. Please find the link for course details:

Selenium Certification Training

Selenium Certification Training

About the Course

Tecklearn’s Selenium Certification Training enables you to master the complete Selenium suite. The Selenium Training is designed to train developers and manual testers to learn how to automate web applications with a robust framework, and integrate it within the DevOps processes of an organization. This Selenium Certification Training will also help you master important concepts such as TestNG, Selenium IDE, Selenium Grid, Selenium WebDriver, etc. Get hands-on experience on widely used automation frameworks such as Data-Driven Framework, Keyword-Driven Framework, Hybrid Framework, and Behavior Driven Development (BDD) Framework. Throughout this online Instructor-led Selenium Certification Training, you will be working on real-life industry use cases.

Why Should you take Selenium Certification Training?

• The average salary of a Selenium Test Automation Engineer is $94k per year – Indeed.com.
• Automation Testing Market is expected to grow at a Compound Annual Growth Rate (CAGR) of 18.0% in the next three years.
• Global software testing market to reach $50 billion by 2020 – NASSCOM. Selenium tool supports more browsers and languages than any other testing tool.

What you will Learn in this Course?

Getting started with Selenium

• Introduction to Selenium testing
• Significance of automation testing
• Comparison of Manual and Automation Testing
• Installation of Java JDK, JRE and Eclipse

Setting the environment in Eclipse for Selenium

• Java Introduction
• Creating a Java function and executing
• Concepts of Java
• Properties File
• Reading Data from Excel File
• Database Connection
• Hands On

Advantages of Selenium automation testing

• Selenium Features
• Concept of Selenium Integrated Development Environment
• Understanding of the Selenium IDE features
• Addition of Script assertions and general commands
• Deploying the first Selenium Script
• Sample project IDE
• Recording Selenium test case
• Hands On

Selenium Web driver Automation

• Architecture of Selenium Web Driver
• Download and installation
• Creating a Java function using Selenium and execution
• Hands On

Deploying Web Drivers for scripting

• Getting the HTML source of Web Element
• Table and Form Elements
• Firebug extension and Fire Path installation
• Advance User Interactions and Cross Browser Testing
• Hands On

Deep dive into Selenium Web Driver

• Action Commands
• Web Table / Date Picker
• How to Implement Switching Commands in WebDriver
• Alerts
• Frames
• Hands On

Switching Operations in WebDriver using Window

• Selenium Webdriver Wait
• Implicit wait, Explicit wait
• Deploying searching elements using the link text, name, using XPath
• Calendar
• Hands On

Introduction to TestNG Framework

• Introduction to TestNG
• Advantages of TestNG
• Installing TestNG on Eclipse
• Rules to write TestNG
• TestNG Features
• Annotations
• Grouping
• Sequencing: Prioritization and Dependency
• Enable/Disable a test case
• Parameterization: Using Xml file and DataProvider
• Parallel Testing & Cross Browser Testing
• TestNG Report: HTML Report, Console Report, XML Report

JUnit Operations and Test Framework

• Annotations, Methods in JUnit
• Junit Test Suites, ANT Build and JUNIT reporting
• Types of Test Automation Framework
• Module Based Testing Framework
• Data Driven Testing Framework
• Keyword Driven Testing Framework
• Hybrid Driven Testing Framework
• How to implement Testing Framework in Project

Object Repository

• Understanding of Object Repository
• Learning sample scripts using object repository
• Page Object Modelling
• Page Factory

JavaScript Functions

• Autosuggestion
• Headless Browser
• Sikuli
• XPath

Got a question for us? Please mention it in the comments section and we will get back to you.

0 responses on "How to Configure Selenium using NUnit in Visual Studio"

Leave a Message

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