SlideShare uma empresa Scribd logo
1 de 20
MaintainableUITests
withSelenium andC#
Jon Limjap
Microsoft MVP forVisual Studio and DevelopmentTechnologies
Philippine Software Industry Association –Tech Council Member
About Me
 Microsoft MVP forVisual Studio and Development
Technologies
 Lead, Philippine .NET Users Group
 PSIATechnical Council Member
 http://jonlimjap.net
 @lattex | jonlimjap@gmail.com
Philippine .NET
UsersGroup
(PHINUG)
facebook.com/groups/phinug
What is Selenium
Selenium basics
Improving Selenium tests with
PageObjects
SeleniumOverview
What is
Selenium?
Quite simply, “Selenium automates
browsers”
Originally started in 2004 by Jason
Huggins as an internal tool at
ThoughtWorks
Written in Java
Useful not only for testing but for
automated tasks, webpage scraping, etc.
Testing
frameworks
powered by
Selenium
 Java
 JUnit
 TestNG
 .NET
 NUnit
 MSTest
 JavaScript
 WebdriverJS
 WebdriverIO
 NightwatchJS
 PHP
 Behat + Menk
 Ruby
 RSpec
 Python
 Robot Framework
 PyUnit
 Py.Test
Selenium Basics
Selenium
Basics
WebDrivers
WebElements
Find Element By
Wait
WebDrivers
DifferentWebdriver for different browsers
Native implementation
 Firefox
Third Party implementations
 Chrome
 IE
 Opera
 Safari
 Edge
 PhantomJS
 Etc…
WebElement
One node of an HTML document
Can contain childWebElements
Properties
 Enabled (bool)
 Selected (bool)
 TagName (string)
 Text (string)
 Etc…
WebElement
Action Methods
 Clear
 Click
 SendKeys
 Submit
Other Userful Methods
 FindElement / FindElements
 GetAttribute
 GetCssValue
Find Elements
By
FindElement/FindElements returns a
WebElement object
These are filtered using the “By” object
 ClassName
 CssSelector
 Name
 Id
 LinkText
 PartialLinkText
 TagName
 Xpath
Chrome DeveloperTools is your friend
 Copy Selector
 Copy XPath
Find Elements
By
Chrome DeveloperTools is your friend
 Copy Selector
 Copy XPath
Selenium in
VisualStudio
Third parties found ways to support
Selenium as early asVisual Studio 2005
via NUnit and Selenium.NET
MSTest support added inVisual Studio
2013
 You can still use NUnit or other test runners
Vastly easier nowadays due to Nuget
Demo
Selenium inVisual Studio using MSTest + C#
ImprovingSelenium
tests with PageObjects
Making tests look saner
PageObjects
Create a class representing each page to
be tested
Create properties forWebElements in the
page
Make methods for repeatedly called
routines
Demo
PageObjects
Q &A |Thank you!
Join PHINUG’s Facebook Group facebook.com/groups/phinug

Mais conteúdo relacionado

Mais procurados

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
 
Selenium (1)
Selenium (1)Selenium (1)
Selenium (1)
onlinemindq
 
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
 

Mais procurados (20)

Selenium webdriver course content rakesh hansalia
Selenium webdriver course content rakesh hansaliaSelenium webdriver course content rakesh hansalia
Selenium webdriver course content rakesh hansalia
 
Efficient Automated Test Creation With Selenium IDE Plugins
Efficient Automated Test Creation With Selenium IDE PluginsEfficient Automated Test Creation With Selenium IDE Plugins
Efficient Automated Test Creation With Selenium IDE Plugins
 
Selenium Testing
Selenium Testing Selenium Testing
Selenium Testing
 
Introduction to Selenium WebDriver
Introduction to Selenium WebDriverIntroduction to Selenium WebDriver
Introduction to Selenium WebDriver
 
Selenium IDE
Selenium IDESelenium IDE
Selenium IDE
 
Selenium ui paradigm - DDD North 2
Selenium ui paradigm - DDD North 2Selenium ui paradigm - DDD North 2
Selenium ui paradigm - DDD North 2
 
Selenium
SeleniumSelenium
Selenium
 
Selenium Interview Questions and Answers For Freshers And Experienced | Edureka
Selenium Interview Questions and Answers For Freshers And Experienced | EdurekaSelenium Interview Questions and Answers For Freshers And Experienced | Edureka
Selenium Interview Questions and Answers For Freshers And Experienced | Edureka
 
Selenium (1)
Selenium (1)Selenium (1)
Selenium (1)
 
Selenium IDE and Beyond
Selenium IDE and BeyondSelenium IDE and Beyond
Selenium IDE and Beyond
 
Selenium IDE Introduction, Installation and Working
Selenium IDE Introduction, Installation and WorkingSelenium IDE Introduction, Installation and Working
Selenium IDE Introduction, Installation and Working
 
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!
 
Selenium By Pravin Mishra
Selenium By Pravin MishraSelenium By Pravin Mishra
Selenium By Pravin Mishra
 
Introduction to Selenium Automation
Introduction to Selenium AutomationIntroduction to Selenium Automation
Introduction to Selenium Automation
 
Basics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote ControlBasics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote Control
 
Selenium topic 3 -Web Driver Basics
Selenium topic 3 -Web Driver BasicsSelenium topic 3 -Web Driver Basics
Selenium topic 3 -Web Driver Basics
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
 
Selenium basic
Selenium basicSelenium basic
Selenium basic
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With Selenium
 
Selenium
SeleniumSelenium
Selenium
 

Semelhante a Maintainable UI Tests with Selenium and C#

Semelhante a Maintainable UI Tests with Selenium and C# (20)

What is Selenium Automation Testing.pdf
What is Selenium Automation Testing.pdfWhat is Selenium Automation Testing.pdf
What is Selenium Automation Testing.pdf
 
Best selenium training eduxfactor
Best selenium training   eduxfactorBest selenium training   eduxfactor
Best selenium training eduxfactor
 
Selenium testing tool
Selenium testing toolSelenium testing tool
Selenium testing tool
 
Best selenium training institute in hyderabad
Best selenium training institute in hyderabadBest selenium training institute in hyderabad
Best selenium training institute in hyderabad
 
Selenium training eduxfactor
Selenium training   eduxfactorSelenium training   eduxfactor
Selenium training eduxfactor
 
best selenium training institute in hyderabad
best selenium training institute in hyderabadbest selenium training institute in hyderabad
best selenium training institute in hyderabad
 
Best selenium training institute in hyderabad
Best selenium training institute in hyderabadBest selenium training institute in hyderabad
Best selenium training institute in hyderabad
 
best selenium training institute in hyderabad
best selenium training institute in hyderabadbest selenium training institute in hyderabad
best selenium training institute in hyderabad
 
software testing training institute in hyderabad
software testing training institute in hyderabadsoftware testing training institute in hyderabad
software testing training institute in hyderabad
 
selenium with python training
selenium with python trainingselenium with python training
selenium with python training
 
Selenium training eduxfactor-converted
Selenium training   eduxfactor-convertedSelenium training   eduxfactor-converted
Selenium training eduxfactor-converted
 
selenium with python training
selenium with python trainingselenium with python training
selenium with python training
 
Selenium training eduxfactor
Selenium training   eduxfactorSelenium training   eduxfactor
Selenium training eduxfactor
 
best selenium training institute in Hyderabad
best selenium training institute in Hyderabadbest selenium training institute in Hyderabad
best selenium training institute in Hyderabad
 
automation courses near me
automation courses near meautomation courses near me
automation courses near me
 
Selenium training eduxfactor
Selenium training   eduxfactorSelenium training   eduxfactor
Selenium training eduxfactor
 
Selenium training
Selenium trainingSelenium training
Selenium training
 
automation courses near me
automation courses near meautomation courses near me
automation courses near me
 
Selenium Training - Eduxfactor.pptx
Selenium Training - Eduxfactor.pptxSelenium Training - Eduxfactor.pptx
Selenium Training - Eduxfactor.pptx
 
Best online Selenium Training institute in Hyderabad
Best online Selenium Training institute in HyderabadBest online Selenium Training institute in Hyderabad
Best online Selenium Training institute in Hyderabad
 

Mais de Jacinto Limjap

Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Jacinto Limjap
 

Mais de Jacinto Limjap (11)

Refactoring to Microservices
Refactoring to MicroservicesRefactoring to Microservices
Refactoring to Microservices
 
Donetconf2016: The Future of C#
Donetconf2016: The Future of C#Donetconf2016: The Future of C#
Donetconf2016: The Future of C#
 
C# and the Evolution of a Programming Language
C# and the Evolution of a Programming LanguageC# and the Evolution of a Programming Language
C# and the Evolution of a Programming Language
 
SQL vs NoSQL
SQL vs NoSQLSQL vs NoSQL
SQL vs NoSQL
 
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
 
N-tier and oop - moving across technologies
N-tier and oop - moving across technologiesN-tier and oop - moving across technologies
N-tier and oop - moving across technologies
 
MSDN Ramp-Up Part 3: Business logic
MSDN Ramp-Up Part 3: Business logicMSDN Ramp-Up Part 3: Business logic
MSDN Ramp-Up Part 3: Business logic
 
Developing windows phone 7 applications
Developing windows phone 7 applicationsDeveloping windows phone 7 applications
Developing windows phone 7 applications
 
Automated Unit Testing in Silverlight for Windows Phone 7
Automated Unit Testing in Silverlight for Windows Phone 7Automated Unit Testing in Silverlight for Windows Phone 7
Automated Unit Testing in Silverlight for Windows Phone 7
 
Dynamics & Object Runtime Composition with C# 4.0
Dynamics & Object Runtime Composition with C# 4.0Dynamics & Object Runtime Composition with C# 4.0
Dynamics & Object Runtime Composition with C# 4.0
 
Three Developer Abilities They Dont Teach In College
Three Developer  Abilities They Dont Teach In CollegeThree Developer  Abilities They Dont Teach In College
Three Developer Abilities They Dont Teach In College
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Maintainable UI Tests with Selenium and C#