fbpx

Selenium Test Automation With C# For Beginners

| Blog,Enterprise Software Development,Software testing

What is selenium?

Selenium is a widely used test automation framework. There are 3 selenium tools; Selenium RC, Selenium IDE and Selenium Webdriver, out of which the Selenium Webdriver is the most commonly used industry tool. Using the Selenium Wedriver the test cases can be automated with C#.

To learn more about selenium, follow the link below:

https://www.seleniumhq.org/docs/01_introducing_selenium.jsp#introducing-selenium

Environment Setup

First, the Visual Studio IDE needs to be installed on to the PC. Next the Selenium Webdriver for C# must be downloaded .

Follow the link below:

https://www.seleniumhq.org/download/

Example

Step 1: Create a new project through Microsoft Visual Studio

Open Visual Studio and go on to the File tab and click on New Project.

Step 2: Add Selenium to the project

Right click on Project Name in Solution, click on Explore and add reference. Then select all DLL files and follow the steps in the image below.

Step 3

Ensure the following code is used for the required resources in the test.

using System;

using System.Text;

using System.Collections.Generic;

using System.Linq;

using OpenQA.Selenium;

using OpenQA.Selenium.Firefox;

using OpenQA.Selenium.Support.UI;

using Microsoft.VisualStudio.TestTools.UnitTesting;

Step 4

The test can then be written inside the test method, and the test can be run. For example, the following test will direct you to the brandixi3 website.

Click here to download our Software Testing brochure for more information

Click here to read more about Brandix i3’s Software Testing and QA Solution

Author: 
Thimali Wijayathilake

Related Posts

From insights to thought-leadership

View More

RPA is here to stay. Can companies remain oblivious?

Robotic process automation, simply known as RPA, came to light in the early 2000s. In the current context, its capabilities are extended with the use of several technologies such as process mining, optical character recognition (OCR), analytics, user experience (UX), artificial intelligence (AI), big data, machine learning (ML), and speech recognition technologies.

Enhance productivity with ERP integrated AI Chatbots

Due to the pandemic, businesses were forced to adapt to new norms with disruptions to usual business operations. The sudden boom in e-commerce has created new requirements. Certain products and services were in high demand, and some businesses struggled with staggering volumes of customer queries and complaints.

Quality Gates: Why all the fuss?

What are quality gates? And what is the role of a gatekeeper? Read our latest blog post by Senior QA Lead Rochana Herath as she details why investing time in identifying quality gates is important and how quality gates significantly improve the success and quality of your software projects.

Move data to Infor’s multi-tenant cloud faster and reliably with M3 Data Import Tool for Multi-Tenant (MDI-MT)

MDI-MT provides a faster, flexible, and feature-rich interface for migrating data from legacy ERP to Infor's multi-tenant cloud built on AWS.

Building business-ready applications with Infor Mongoose: 4 success stories

In the previous blog post, we discussed building low-code feature-rich CloudSuite applications with Infor Mongoose. In this article, we explore applications developed using Infor Mongoose at Fortude.

ASP.NET Core Dependency Injection and Service Lifetimes

ASP.NET Core supports the Dependency Injection (DI) software design pattern that allows registering services and controlling how these services are instantiated and injected in different components.