Selenium Test Automation With C# For Beginners

19th of January 2017 | 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

Harmonizing retail after the pandemic

Fashion retailers can maximize sales and increase customer satisfaction by establishing a harmonized retail strategy. Read how selecting the right channels, stock fluidity, adaptable software, and analytics can help in our latest blog post.

The Omnichannel Dilemma

Omnichannel has been a buzzword across fashion retail for so long that the industry should have moved on to the next big idea by now. Increased digitization due the pandemic, coupled with other challenges of the post-covid retail climate, has resulted in the term omnichannel appearing consistently in retail studies and white papers.

On-site Customer Support: Eight Strategies for Exceeding Customer Expectations

Organizations often demand the on-site presence of techno-functional expertise for critical IT transformation projects. For certain projects, on-site support is not optional. For many, having expertise on-site ensures the implementation progresses as planned—and more importantly, experts foresee risks and mitigate them before they impede the project. The higher the complexity and the scale of the project, the higher the risk associated with the change.

Sustainability and Fashion: What’s the score?

Continuing our two-part blog we delve into how technology can be a key enabler and driver of helping fashion brands improve their sustainability and transparency efforts. It further details the concept of a sustainability score and how it can be incorporated into systems such as PLM to provide visibility and assist with a company's sustainability initiatives.

Sustainability in Fashion: A pandemical wake-up call

In this two-part blog post, we explore the pressures the fashion industry is facing today: supply chain transparency, sustainability, ethical manufacturing, and conscious consumers demanding eco-friendly clothing, and furthermore reveal what businesses can do to increase visibility and how technology can help alleviate some of these concerns.

Realizing HR functions in a virtual workplace

2020 has challenged us to change the way we work and engage. Read how Fortude has adapted and optimized its people practice collaboration, and service delivery methodology to face the new normal, in our latest blog post written by Oshana Dias, Global SVP - Human Resources, Fortude.