SlideShare a Scribd company logo
Automation using Selenium with C#
Authored & Presented by : Yogesh Kumar
ucreate.it Pvt. Ltd.
Setting up the project - Step1

Download and Install Visual Studio
.

Selenium is an open source suite that is used for web applications test
automation.

It allows recording or scripting automated test flows.

It uses a test domain-specific language Selenese.

Tests can be written in a number of popular programming languages,
including C#, Java, PHP, Python, Ruby, Groovy and Scala.

Automation is supported for multiple web browsers as well multiple
platforms.
What is Selenium?

Selenium WebDriver is used for creation of robust, browser-based
regression automation suites.

Tests can be run in different browsers.

Selenium WebDriver, simply, accepts programmedcommands, sends
them to a browser and interacts with the HTML elements on the page.

Before driver can interact with the element, it need to be located (find) in
the page.

TheWebDriver’s method findElement() is used for that purpose.
Selenium Web Driver
The driver can find elements on the web page using several types of
locators:
• By Id
• By Class Name
• By Tag Name
• By Name
• By Link Text
• By CSS
• By Xpath
These locators will search the web page’s HTML and find particular
element(s) based on the supplied Id, XPath, ClassName etc.
After driver, finds element, it is returned as WebElement object.
WebElement objects, expose methods that simulate “human” interaction
with the page. Methods that often used are: click(), sendKeys(), submit(),
getText(), etc.
Locators in Selenium Web Driver
Why Selenium with C#

NO Major difference between Selenium C# with Java, It’s just the
language difference along with some changes here and there to
support new firefox browser or chrome etc in both of these
languages.

Ease of setting up scripting or running environment

Easy to generate reports with ReportNG.

Easy to start with Nunit.
Note: In this tutorial we will build an example for Smoke Test on LinkedIn web
application. The scenario
will cover user log in, navigation to the edit profile page, elements validation on
the profile page and log
out.
BUILD SELENIUM TESTS USING
NUNIT FRAMEWORK
Setting up the project - Step1

Download and Install Visual Studio
Setting up the project – Step 2

open Visual Studio and create new project
Setting up the project – Step 3

Select Test and create Unit Test project
Setting up the project – Step 4

Project will be created like attached screen.
Setting up the project – Step 5

Now Build the solution, it will create test case
Setting up the project – Step 6

Go to NuGet Packages to add selenium
Setting up the project – Step 7

Now, install Selenium Support to add Selenium
Setting up the project – Step 8

Now, install Chrome Driver
Write Test Script - Step 1
Write this small code:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
namespace UnitTestProject1
{
[TestClass]
public class UnitTest1
{
IWebDriver driver;
[TestMethod]
public void TestMethod1()
{
Write Test Script - Step 1
driver = new ChromeDriver();
driver.Url = "http://www.google.co.in";
}
}
}
Running the Test – Step 1

Now Build the solution Again
Running the Test – Step 2

Right click on Test and run selected Test.
Running the Test – Step 3

It will open Browser.

In browser, google website will be openend up.

Simple and easy
Playing with the Code

Find Element.

Perform operation on Element.

Run the test.
Questions
Thank You !!!

More Related Content

What's hot (20)

Selenium topic 4 - Selenium Web Driver Set Up
Selenium topic 4 - Selenium Web Driver Set UpSelenium topic 4 - Selenium Web Driver Set Up
Selenium topic 4 - Selenium Web Driver Set Up
ITProfessional Academy
 
Selenium introduction
Selenium introductionSelenium introduction
Selenium introduction
Pankaj Dubey
 
Selenium with java
Selenium with javaSelenium with java
Selenium with java
Satyam Pandey
 
Selenium Topic 2 IDE
Selenium Topic 2 IDESelenium Topic 2 IDE
Selenium Topic 2 IDE
ITProfessional Academy
 
Selenium Maven With Eclipse | Edureka
Selenium Maven With Eclipse | EdurekaSelenium Maven With Eclipse | Edureka
Selenium Maven With Eclipse | Edureka
Edureka!
 
Run Selenium Tests With Jenkins and BrowseEmAll
Run Selenium Tests With Jenkins and BrowseEmAllRun Selenium Tests With Jenkins and BrowseEmAll
Run Selenium Tests With Jenkins and BrowseEmAll
Daniel Herken
 
Selenium (1)
Selenium (1)Selenium (1)
Selenium (1)
onlinemindq
 
Selenium webdriver course content rakesh hansalia
Selenium webdriver course content rakesh hansaliaSelenium webdriver course content rakesh hansalia
Selenium webdriver course content rakesh hansalia
Rakesh Hansalia
 
Testing with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous DeploymentTesting with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous Deployment
Max Klymyshyn
 
Selenium topic 3 -Web Driver Basics
Selenium topic 3 -Web Driver BasicsSelenium topic 3 -Web Driver Basics
Selenium topic 3 -Web Driver Basics
ITProfessional Academy
 
Selenium 2: The Future of Selenium is now!
Selenium 2: The Future of Selenium is now!Selenium 2: The Future of Selenium is now!
Selenium 2: The Future of Selenium is now!
AutomatedTester
 
Selenium Demo
Selenium DemoSelenium Demo
Selenium Demo
ankitslide
 
Selenium Automation
Selenium AutomationSelenium Automation
Selenium Automation
Anuradha Malalasena
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
Pavan Kumar
 
Jenkins & Selenium
Jenkins & SeleniumJenkins & Selenium
Jenkins & Selenium
adamcarmi
 
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
Agile Testing Alliance
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Selenium
vivek_prahlad
 
Selenium test automation
Selenium test automationSelenium test automation
Selenium test automation
Srikanth Vuriti
 
Selenium topic 1- Selenium Basic
Selenium topic 1-  Selenium BasicSelenium topic 1-  Selenium Basic
Selenium topic 1- Selenium Basic
ITProfessional Academy
 
Mastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsMastering selenium for automated acceptance tests
Mastering selenium for automated acceptance tests
Nick Belhomme
 
Selenium topic 4 - Selenium Web Driver Set Up
Selenium topic 4 - Selenium Web Driver Set UpSelenium topic 4 - Selenium Web Driver Set Up
Selenium topic 4 - Selenium Web Driver Set Up
ITProfessional Academy
 
Selenium introduction
Selenium introductionSelenium introduction
Selenium introduction
Pankaj Dubey
 
Selenium Maven With Eclipse | Edureka
Selenium Maven With Eclipse | EdurekaSelenium Maven With Eclipse | Edureka
Selenium Maven With Eclipse | Edureka
Edureka!
 
Run Selenium Tests With Jenkins and BrowseEmAll
Run Selenium Tests With Jenkins and BrowseEmAllRun Selenium Tests With Jenkins and BrowseEmAll
Run Selenium Tests With Jenkins and BrowseEmAll
Daniel Herken
 
Selenium webdriver course content rakesh hansalia
Selenium webdriver course content rakesh hansaliaSelenium webdriver course content rakesh hansalia
Selenium webdriver course content rakesh hansalia
Rakesh Hansalia
 
Testing with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous DeploymentTesting with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous Deployment
Max Klymyshyn
 
Selenium 2: The Future of Selenium is now!
Selenium 2: The Future of Selenium is now!Selenium 2: The Future of Selenium is now!
Selenium 2: The Future of Selenium is now!
AutomatedTester
 
Jenkins & Selenium
Jenkins & SeleniumJenkins & Selenium
Jenkins & Selenium
adamcarmi
 
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
Agile Testing Alliance
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Selenium
vivek_prahlad
 
Selenium test automation
Selenium test automationSelenium test automation
Selenium test automation
Srikanth Vuriti
 
Mastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsMastering selenium for automated acceptance tests
Mastering selenium for automated acceptance tests
Nick Belhomme
 

Similar to Selenium using C# by Yogesh Kumar (20)

Automated testing using Selenium & NUnit
Automated testing using Selenium & NUnitAutomated testing using Selenium & NUnit
Automated testing using Selenium & NUnit
Alfred Jett Grandeza
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With Selenium
Jodie Miners
 
Selenium Automation
Selenium AutomationSelenium Automation
Selenium Automation
Pratyush Majumdar
 
Automation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverAutomation Testing using Selenium Webdriver
Automation Testing using Selenium Webdriver
Pankaj Biswas
 
Introduction to selenium
Introduction to seleniumIntroduction to selenium
Introduction to selenium
Khaja Moiz Uddin
 
Introduction to selenium
Introduction to seleniumIntroduction to selenium
Introduction to selenium
Khaja Moiz Uddin
 
Selenium
SeleniumSelenium
Selenium
David Rajah Selvaraj
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
Cynoteck Technology Solutions Private Limited
 
Web testing with Selenium
Web testing with SeleniumWeb testing with Selenium
Web testing with Selenium
XBOSoft
 
Webinar: Selenium WebDriver - Automation Uncomplicated
Webinar: Selenium WebDriver - Automation UncomplicatedWebinar: Selenium WebDriver - Automation Uncomplicated
Webinar: Selenium WebDriver - Automation Uncomplicated
Edureka!
 
Selenium C# - The Essential Test Automation Guide
Selenium C# - The Essential Test Automation GuideSelenium C# - The Essential Test Automation Guide
Selenium C# - The Essential Test Automation Guide
RapidValue
 
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
Lesson_06_Software_and_Automation_Testing_Frameworks.pdfLesson_06_Software_and_Automation_Testing_Frameworks.pdf
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
Minh Quân Đoàn
 
Selenium Automation Testing - A Complete Guide.pdf
Selenium Automation Testing - A Complete Guide.pdfSelenium Automation Testing - A Complete Guide.pdf
Selenium Automation Testing - A Complete Guide.pdf
kalichargn70th171
 
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World ExamplesMastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
jamescantor38
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
Dave Haeffner
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using Selenium
Naresh Chintalcheru
 
Integrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectIntegrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala Project
Knoldus Inc.
 
Selenium
SeleniumSelenium
Selenium
Daksh Sharma
 
Selenium
SeleniumSelenium
Selenium
abiramimaya
 
Selenium Automation Testing - A Complete Guide.pdf
Selenium Automation Testing - A Complete Guide.pdfSelenium Automation Testing - A Complete Guide.pdf
Selenium Automation Testing - A Complete Guide.pdf
flufftailshop
 
Automated testing using Selenium & NUnit
Automated testing using Selenium & NUnitAutomated testing using Selenium & NUnit
Automated testing using Selenium & NUnit
Alfred Jett Grandeza
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With Selenium
Jodie Miners
 
Automation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverAutomation Testing using Selenium Webdriver
Automation Testing using Selenium Webdriver
Pankaj Biswas
 
Web testing with Selenium
Web testing with SeleniumWeb testing with Selenium
Web testing with Selenium
XBOSoft
 
Webinar: Selenium WebDriver - Automation Uncomplicated
Webinar: Selenium WebDriver - Automation UncomplicatedWebinar: Selenium WebDriver - Automation Uncomplicated
Webinar: Selenium WebDriver - Automation Uncomplicated
Edureka!
 
Selenium C# - The Essential Test Automation Guide
Selenium C# - The Essential Test Automation GuideSelenium C# - The Essential Test Automation Guide
Selenium C# - The Essential Test Automation Guide
RapidValue
 
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
Lesson_06_Software_and_Automation_Testing_Frameworks.pdfLesson_06_Software_and_Automation_Testing_Frameworks.pdf
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
Minh Quân Đoàn
 
Selenium Automation Testing - A Complete Guide.pdf
Selenium Automation Testing - A Complete Guide.pdfSelenium Automation Testing - A Complete Guide.pdf
Selenium Automation Testing - A Complete Guide.pdf
kalichargn70th171
 
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World ExamplesMastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
jamescantor38
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
Dave Haeffner
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using Selenium
Naresh Chintalcheru
 
Integrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectIntegrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala Project
Knoldus Inc.
 
Selenium Automation Testing - A Complete Guide.pdf
Selenium Automation Testing - A Complete Guide.pdfSelenium Automation Testing - A Complete Guide.pdf
Selenium Automation Testing - A Complete Guide.pdf
flufftailshop
 
Ad

More from Software Testing Board (11)

Software Testing Board meetup 24th-Nov-2018
Software Testing Board meetup 24th-Nov-2018Software Testing Board meetup 24th-Nov-2018
Software Testing Board meetup 24th-Nov-2018
Software Testing Board
 
Manage Selenium Grid with Terraform by Omkar Khatavkar (https://www.linkedin....
Manage Selenium Grid with Terraform by Omkar Khatavkar (https://www.linkedin....Manage Selenium Grid with Terraform by Omkar Khatavkar (https://www.linkedin....
Manage Selenium Grid with Terraform by Omkar Khatavkar (https://www.linkedin....
Software Testing Board
 
Introduction to Selenium Python by Kishore
Introduction to Selenium Python by KishoreIntroduction to Selenium Python by Kishore
Introduction to Selenium Python by Kishore
Software Testing Board
 
Shell scripting to test volume of SEO pages with ease by Abdul Hadi
Shell scripting to test volume of SEO pages with ease by Abdul Hadi Shell scripting to test volume of SEO pages with ease by Abdul Hadi
Shell scripting to test volume of SEO pages with ease by Abdul Hadi
Software Testing Board
 
BRD document for test automation estimation
BRD document for test automation estimationBRD document for test automation estimation
BRD document for test automation estimation
Software Testing Board
 
Micro Service automation by Srijit Jain
Micro Service automation by Srijit JainMicro Service automation by Srijit Jain
Micro Service automation by Srijit Jain
Software Testing Board
 
Docker with Selenium by Thirumalai Vignesh
Docker with Selenium by Thirumalai VigneshDocker with Selenium by Thirumalai Vignesh
Docker with Selenium by Thirumalai Vignesh
Software Testing Board
 
A testers survival guide for agile transition by Parveen Sultana
A testers survival guide for agile transition by Parveen SultanaA testers survival guide for agile transition by Parveen Sultana
A testers survival guide for agile transition by Parveen Sultana
Software Testing Board
 
Shift left shift-right performance testing for superior end-user by Arun Dutta
Shift left shift-right performance testing for superior end-user by Arun DuttaShift left shift-right performance testing for superior end-user by Arun Dutta
Shift left shift-right performance testing for superior end-user by Arun Dutta
Software Testing Board
 
Software Testing Board's start-here guide for the Question and Answer site
Software Testing Board's start-here guide for the Question and Answer siteSoftware Testing Board's start-here guide for the Question and Answer site
Software Testing Board's start-here guide for the Question and Answer site
Software Testing Board
 
Agile Testing by ShriKant Vashishtha
Agile Testing by ShriKant VashishthaAgile Testing by ShriKant Vashishtha
Agile Testing by ShriKant Vashishtha
Software Testing Board
 
Software Testing Board meetup 24th-Nov-2018
Software Testing Board meetup 24th-Nov-2018Software Testing Board meetup 24th-Nov-2018
Software Testing Board meetup 24th-Nov-2018
Software Testing Board
 
Manage Selenium Grid with Terraform by Omkar Khatavkar (https://www.linkedin....
Manage Selenium Grid with Terraform by Omkar Khatavkar (https://www.linkedin....Manage Selenium Grid with Terraform by Omkar Khatavkar (https://www.linkedin....
Manage Selenium Grid with Terraform by Omkar Khatavkar (https://www.linkedin....
Software Testing Board
 
Introduction to Selenium Python by Kishore
Introduction to Selenium Python by KishoreIntroduction to Selenium Python by Kishore
Introduction to Selenium Python by Kishore
Software Testing Board
 
Shell scripting to test volume of SEO pages with ease by Abdul Hadi
Shell scripting to test volume of SEO pages with ease by Abdul Hadi Shell scripting to test volume of SEO pages with ease by Abdul Hadi
Shell scripting to test volume of SEO pages with ease by Abdul Hadi
Software Testing Board
 
BRD document for test automation estimation
BRD document for test automation estimationBRD document for test automation estimation
BRD document for test automation estimation
Software Testing Board
 
Micro Service automation by Srijit Jain
Micro Service automation by Srijit JainMicro Service automation by Srijit Jain
Micro Service automation by Srijit Jain
Software Testing Board
 
Docker with Selenium by Thirumalai Vignesh
Docker with Selenium by Thirumalai VigneshDocker with Selenium by Thirumalai Vignesh
Docker with Selenium by Thirumalai Vignesh
Software Testing Board
 
A testers survival guide for agile transition by Parveen Sultana
A testers survival guide for agile transition by Parveen SultanaA testers survival guide for agile transition by Parveen Sultana
A testers survival guide for agile transition by Parveen Sultana
Software Testing Board
 
Shift left shift-right performance testing for superior end-user by Arun Dutta
Shift left shift-right performance testing for superior end-user by Arun DuttaShift left shift-right performance testing for superior end-user by Arun Dutta
Shift left shift-right performance testing for superior end-user by Arun Dutta
Software Testing Board
 
Software Testing Board's start-here guide for the Question and Answer site
Software Testing Board's start-here guide for the Question and Answer siteSoftware Testing Board's start-here guide for the Question and Answer site
Software Testing Board's start-here guide for the Question and Answer site
Software Testing Board
 
Ad

Recently uploaded (20)

SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptxSEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
PoojaSen20
 
How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18
Celine George
 
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
Quiz Club of PSG College of Arts & Science
 
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
GeorgeDiamandis11
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptxjune 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big CycleRay Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
Quiz Club of PSG College of Arts & Science
 
Parenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independenceParenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independence
Pooky Knightsmith
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptxWhat is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptxAnalysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
How to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 EmployeeHow to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 Employee
Celine George
 
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Celine George
 
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptxDiptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Arshad Shaikh
 
Optimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptxOptimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptx
UrmiPrajapati3
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
National Information Standards Organization (NISO)
 
Exploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle SchoolExploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle School
Marie
 
Capitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptxCapitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptx
CapitolTechU
 
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptxSEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
PoojaSen20
 
How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18
Celine George
 
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
GeorgeDiamandis11
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptxjune 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big CycleRay Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
Parenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independenceParenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independence
Pooky Knightsmith
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptxWhat is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptxAnalysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
How to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 EmployeeHow to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 Employee
Celine George
 
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Celine George
 
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptxDiptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Arshad Shaikh
 
Optimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptxOptimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptx
UrmiPrajapati3
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
Exploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle SchoolExploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle School
Marie
 
Capitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptxCapitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptx
CapitolTechU
 

Selenium using C# by Yogesh Kumar

  • 1. Automation using Selenium with C# Authored & Presented by : Yogesh Kumar ucreate.it Pvt. Ltd.
  • 2. Setting up the project - Step1  Download and Install Visual Studio
  • 3. .  Selenium is an open source suite that is used for web applications test automation.  It allows recording or scripting automated test flows.  It uses a test domain-specific language Selenese.  Tests can be written in a number of popular programming languages, including C#, Java, PHP, Python, Ruby, Groovy and Scala.  Automation is supported for multiple web browsers as well multiple platforms. What is Selenium?
  • 4.  Selenium WebDriver is used for creation of robust, browser-based regression automation suites.  Tests can be run in different browsers.  Selenium WebDriver, simply, accepts programmedcommands, sends them to a browser and interacts with the HTML elements on the page.  Before driver can interact with the element, it need to be located (find) in the page.  TheWebDriver’s method findElement() is used for that purpose. Selenium Web Driver
  • 5. The driver can find elements on the web page using several types of locators: • By Id • By Class Name • By Tag Name • By Name • By Link Text • By CSS • By Xpath These locators will search the web page’s HTML and find particular element(s) based on the supplied Id, XPath, ClassName etc. After driver, finds element, it is returned as WebElement object. WebElement objects, expose methods that simulate “human” interaction with the page. Methods that often used are: click(), sendKeys(), submit(), getText(), etc. Locators in Selenium Web Driver
  • 6. Why Selenium with C#  NO Major difference between Selenium C# with Java, It’s just the language difference along with some changes here and there to support new firefox browser or chrome etc in both of these languages.  Ease of setting up scripting or running environment  Easy to generate reports with ReportNG.  Easy to start with Nunit.
  • 7. Note: In this tutorial we will build an example for Smoke Test on LinkedIn web application. The scenario will cover user log in, navigation to the edit profile page, elements validation on the profile page and log out. BUILD SELENIUM TESTS USING NUNIT FRAMEWORK
  • 8. Setting up the project - Step1  Download and Install Visual Studio
  • 9. Setting up the project – Step 2  open Visual Studio and create new project
  • 10. Setting up the project – Step 3  Select Test and create Unit Test project
  • 11. Setting up the project – Step 4  Project will be created like attached screen.
  • 12. Setting up the project – Step 5  Now Build the solution, it will create test case
  • 13. Setting up the project – Step 6  Go to NuGet Packages to add selenium
  • 14. Setting up the project – Step 7  Now, install Selenium Support to add Selenium
  • 15. Setting up the project – Step 8  Now, install Chrome Driver
  • 16. Write Test Script - Step 1 Write this small code: using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using OpenQA.Selenium; using OpenQA.Selenium.Chrome; namespace UnitTestProject1 { [TestClass] public class UnitTest1 { IWebDriver driver; [TestMethod] public void TestMethod1() {
  • 17. Write Test Script - Step 1 driver = new ChromeDriver(); driver.Url = "http://www.google.co.in"; } } }
  • 18. Running the Test – Step 1  Now Build the solution Again
  • 19. Running the Test – Step 2  Right click on Test and run selected Test.
  • 20. Running the Test – Step 3  It will open Browser.  In browser, google website will be openend up.  Simple and easy
  • 21. Playing with the Code  Find Element.  Perform operation on Element.  Run the test.