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

Post-pandemic fashion manufacturing: Essential technology for the manufacturer

In my previous blog series I discussed how fashion companies could adapt to meet the challenges of the new normal. For the most part, I focused on brands, but the same principles apply to fashion manufacturing. In this blog post, let’s focus on how manufacturers can adapt to the new normal by achieving visibility and collaboration with the right software.

Post-pandemic fashion manufacturing: Bridging the East-West divide

Twenty years ago, I started my career at an Asian apparel manufacturer. Tech-packs would come in from big brands from the US and Europe. We would gather in meeting rooms late into the night, deciphering the documents and pulling together a sample as best we could. If the sample was approved, we would confirm delivery dates to the brand six months in advance.

Is moving to the cloud the secret to a more sustainable supply chain?

Corporate sustainability is increasingly becoming a differentiator of business performance and financial success. Not only will sustainability help the planet recover from the harm that has been inflicted by aggressive industrialization, but it will also add value to your brand by attracting eco-conscious customers who demand green products.

Drive growth and digitize your supply chain with marketplace dropshipping

Fashion and luxury brands that have adopted dropshipping and e-commerce marketplaces are geared to capitalizing on the collapse of brick-and-mortar retail. In the new digitally-centered world of e-commerce, these businesses can maximize revenue, increase market share, and offer a seamless customer experience through dropshipping marketplaces. Read more in our latest blog post written in collaboration with Absolutelabs.

The Value of Data Analytics in Fashion eCommerce

The fashion industry is easily one of the biggest players in global eCommerce. Although this giant sector has had its fair share of setbacks following the effects of the pandemic, experts are expecting a stellar recovery in the coming years.

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.