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

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.

Enabling farm-to-table transparency and visibility with Industry 4.0 technologies

In our last blog post on food supply chain visibility, we talked about why visibility and related concepts such as transparency and traceability matter. In this blog post, we delve into how food and beverage manufacturers and retailers can optimally use Industry 4.0 technologies to achieve and deliver stakeholder expectations concerning visibility, transparency, and traceability.

Building low-code feature-rich applications for CloudSuite with Infor Mongoose

A part of Infor CloudSuite, Mongoose acts as a Platform-as-a-Service (PaaS) and is fully integrated with Infor Ming.le and Infor ION. Due to Mongoose's ability to simplify the application designing and deployment process, Nucleus Research recently positioned Infor as a Leader in the Low-Code Application Platforms Value Matrix.

Six reasons to embrace food supply chain transparency

F&B manufacturers should not consider supply chain transparency a burden or an invasion of company privacy. When done right, transparency can benefit all stakeholders in the F&B supply chain: manufacturers, logistics, retailers, regulatory bodies, & most importantly, the conscious consumers. Explore why transparency matters and key concepts such as visibility, and traceability, in our latest blog post:

Making the most of your data with Infor-Ephesoft integration

Businesses generate mountains of data throughout the supply chain and at various customer and partner touchpoints. Leveraging these data is one of the critical goals for enterprises driven by innovation and as it helps them be more competitive, productive, and digital.

Finance & Accounting Guide: Enhancing productivity and accelerating processes with IDM Capture

The finance and accounting departments and processes are among the most critical and essential functions of a business. However, multiple studies indicate that about 50% of organizations are still wrangling their data manually.