SlideShare a Scribd company logo
Les DSL et "fluent interface" pour les tests ASP.NET avec Selenium FluentSelenium
Content ,[object Object]
Best practices for testing
FluentSelenium
Conclusion
Selenium introduction Selenium is a suite of tools to automate web app testing across many platforms ,[object Object],[object Object],[object Object]
Here's a web test written with selenium selenium.Open( "Forum/AllPosts.aspx" ); selenium.WaitForPageToLoad( "8000" ); selenium.Click( "newPost" ); selenium.WaitForPageToLoad( "8000" ); selenium.Type( "//*[contains(@id, 'txtAuthor')]" ,  "Luc" ); selenium.Type( "//*[contains(@id, 'txtSubject')]" ,  "Simple example of the library." ); selenium.Click( "//*[contains(@id, 'btnSavePost')]" ); selenium.WaitForPageToLoad( "8000" ); Assert .AreEqual( "Luc" , selenium.GetText( "//table[contains(@id, 'grdPosts')]//tr[2]/td[2]" ));
Xpath introduction XPath is a structred XML query language Example : get the node of the employee with ID 123456 Employees/Employee[@EmployeeID='123456'] < Employees > < Employee   EmployeeID = &quot; 123456 &quot; > < LastName > Laporte </ LastName > < FirstName > Jacques </ FirstName > </ Employee > < Employee   EmployeeID = &quot; 654321 &quot; > < LastName > Gendron </ LastName > < FirstName > Pierre </ FirstName > </ Employee > </ Employees >
Xpath introduction XPath is a structred XML query language Example : get the last name of the employee with ID 123456 : Employees/Employee[@EmployeeID='123456']/LastName < Employees > < Employee   EmployeeID = &quot; 123456 &quot; > < LastName > Laporte </ LastName > < FirstName > Jacques </ FirstName > </ Employee > < Employee   EmployeeID = &quot; 654321 &quot; > < LastName > Gendron </ LastName > < FirstName > Pierre </ FirstName > </ Employee > </ Employees >
Selenium and XPath on HTML Because HTML is an XML derivative, XPath can be used to locate nodes in a HTML web page Example : ask selenium to click on the Save button : selenium.Click(“//input[@id='btnSubmit']”); selenium.WaitForPageToLoad(“5000”); < html > < body > < form > < div >Hello World !</ div > < input   type = &quot; submit &quot;   value = &quot; Save &quot;   id = &quot; btnSubmit &quot;  /> </ form > </ body > </ html >
Complete simple web test with selenium
Content ,[object Object],[object Object]
FluentSelenium
Conclusion
Good testing practices ,[object Object]
Test independance
Test clarity
Test coverage Should we aim for 100% coverage?
The trade offs
What does this mean? Integrated  tests Unit tests Test coverage
Best practices of test coverage ,[object Object]
Favor coverage through testing of services and domain objects over UI testing
Use patterns that facilitate testing close to the UI layer such as  MVC
Aim for coverage that gives you confidence in the quality of your deliverables
[object Object],Keep tests independent because: ,[object Object]
They will be easier to read
They will not be impacted by updates in other tests
Some things to consider... ,[object Object],[object Object]
Database: Sqlite ,[object Object]
Test Clarity ,[object Object]
Tests are code also. Team code quality rules should also be applied to tests.
XPATH is dangerous, use it wisely Use ID-based queries when possible //*[@id = 'searchResultCount']
Avoid exessive XPATH steps When requiring further qualification in searches only add necessary qualifiers Favor //*[@id='searchResults']//li[1] Over /html/body//div[@id='searchResults']/ul/li[1]
XPATH queries are not clear Xpath expressions are the kind of literal who's meaning can be hard to decipher.  Use constants. Favor selenium.GetText(SearchResultSummaryLocator); Over selenium.GetText( &quot;//*[@id='searchResultsSummary']&quot; );
Keep the test code clean ,[object Object]
Hard to read tests are hard maintain
Tests serve as application behavior documentation
The importance of language in tests ,[object Object]
[object Object],[object Object]
Users
Testers

More Related Content

What's hot

Tdd in php a brief example
Tdd in php   a brief exampleTdd in php   a brief example
Tdd in php a brief exampleJeremy Kendall
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
guestc8093a6
 
Beyond Unit Testing
Beyond Unit TestingBeyond Unit Testing
Beyond Unit TestingSøren Lund
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven Development
Tung Nguyen Thanh
 
Behavior Driven Development with SpecFlow
Behavior Driven Development with SpecFlowBehavior Driven Development with SpecFlow
Behavior Driven Development with SpecFlow
Rachid Kherrazi
 
TDD And Refactoring
TDD And RefactoringTDD And Refactoring
TDD And Refactoring
Naresh Jain
 
Unit Testing in Action - C#, NUnit, and Moq
Unit Testing in Action - C#, NUnit, and MoqUnit Testing in Action - C#, NUnit, and Moq
Unit Testing in Action - C#, NUnit, and Moq
XPDays
 
TDD in PHP - Memphis PHP 2011-08-25
TDD in PHP - Memphis PHP 2011-08-25TDD in PHP - Memphis PHP 2011-08-25
TDD in PHP - Memphis PHP 2011-08-25Jeremy Kendall
 
Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated Testing
Lee Englestone
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)
David Ehringer
 
Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010
guest5639fa9
 
Reduce Reuse Refactor
Reduce Reuse RefactorReduce Reuse Refactor
Reduce Reuse Refactor
Alena Holligan
 
TDD - Agile
TDD - Agile TDD - Agile
TDD - Agile
harinderpisces
 
Testing the untestable
Testing the untestableTesting the untestable
Testing the untestable
RoyKlein
 
Behaviour Driven Development with SpecFlow
Behaviour Driven Development with SpecFlowBehaviour Driven Development with SpecFlow
Behaviour Driven Development with SpecFlow
Pascal Laurin
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development
CodeOps Technologies LLP
 
Software Quality via Unit Testing
Software Quality via Unit TestingSoftware Quality via Unit Testing
Software Quality via Unit Testing
Shaun Abram
 
A Brief Introduction to Zend_Form
A Brief Introduction to Zend_FormA Brief Introduction to Zend_Form
A Brief Introduction to Zend_Form
Jeremy Kendall
 
Unit testing
Unit testing Unit testing
Unit testing
dubbu
 
Codeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiCodeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansai
Florent Batard
 

What's hot (20)

Tdd in php a brief example
Tdd in php   a brief exampleTdd in php   a brief example
Tdd in php a brief example
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Beyond Unit Testing
Beyond Unit TestingBeyond Unit Testing
Beyond Unit Testing
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven Development
 
Behavior Driven Development with SpecFlow
Behavior Driven Development with SpecFlowBehavior Driven Development with SpecFlow
Behavior Driven Development with SpecFlow
 
TDD And Refactoring
TDD And RefactoringTDD And Refactoring
TDD And Refactoring
 
Unit Testing in Action - C#, NUnit, and Moq
Unit Testing in Action - C#, NUnit, and MoqUnit Testing in Action - C#, NUnit, and Moq
Unit Testing in Action - C#, NUnit, and Moq
 
TDD in PHP - Memphis PHP 2011-08-25
TDD in PHP - Memphis PHP 2011-08-25TDD in PHP - Memphis PHP 2011-08-25
TDD in PHP - Memphis PHP 2011-08-25
 
Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated Testing
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)
 
Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010
 
Reduce Reuse Refactor
Reduce Reuse RefactorReduce Reuse Refactor
Reduce Reuse Refactor
 
TDD - Agile
TDD - Agile TDD - Agile
TDD - Agile
 
Testing the untestable
Testing the untestableTesting the untestable
Testing the untestable
 
Behaviour Driven Development with SpecFlow
Behaviour Driven Development with SpecFlowBehaviour Driven Development with SpecFlow
Behaviour Driven Development with SpecFlow
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development
 
Software Quality via Unit Testing
Software Quality via Unit TestingSoftware Quality via Unit Testing
Software Quality via Unit Testing
 
A Brief Introduction to Zend_Form
A Brief Introduction to Zend_FormA Brief Introduction to Zend_Form
A Brief Introduction to Zend_Form
 
Unit testing
Unit testing Unit testing
Unit testing
 
Codeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiCodeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansai
 

Similar to FluentSelenium Presentation Code Camp09

Selenium
SeleniumSelenium
Selenium
Adam Goucher
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
SpringPeople
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
ciklum_ods
 
Web App Testing With Selenium
Web App Testing With SeleniumWeb App Testing With Selenium
Web App Testing With Seleniumjoaopmaia
 
Functional Testing Swing Applications with Frankenstein
Functional Testing Swing Applications with FrankensteinFunctional Testing Swing Applications with Frankenstein
Functional Testing Swing Applications with Frankenstein
vivek_prahlad
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
wiradikusuma
 
Eclipse 40 and Eclipse e4
Eclipse 40 and Eclipse e4 Eclipse 40 and Eclipse e4
Eclipse 40 and Eclipse e4
Lars Vogel
 
Eclipse e4 on Java Forum Stuttgart 2010
Eclipse e4 on Java Forum Stuttgart 2010Eclipse e4 on Java Forum Stuttgart 2010
Eclipse e4 on Java Forum Stuttgart 2010
Lars Vogel
 
Selenium
SeleniumSelenium
Selenium
Ruturaj Doshi
 
Susan windsor soft test 16th november 2005
Susan windsor soft test   16th november 2005Susan windsor soft test   16th november 2005
Susan windsor soft test 16th november 2005
David O'Dowd
 
Javazone 2010-lift-framework-public
Javazone 2010-lift-framework-publicJavazone 2010-lift-framework-public
Javazone 2010-lift-framework-public
Timothy Perrett
 
Interview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlotInterview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlot
Learning Slot
 
Testing Ajax Web Applications
Testing Ajax Web ApplicationsTesting Ajax Web Applications
Testing Ajax Web Applications
Ted Husted
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSF
SoftServe
 
Improving code quality using CI
Improving code quality using CIImproving code quality using CI
Improving code quality using CI
Martin de Keijzer
 
Struts2
Struts2Struts2
Automated Testing Of Web Applications Using XML
Automated  Testing Of  Web  Applications Using  XMLAutomated  Testing Of  Web  Applications Using  XML
Automated Testing Of Web Applications Using XML
diongillard
 

Similar to FluentSelenium Presentation Code Camp09 (20)

Selenium
SeleniumSelenium
Selenium
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
 
Web App Testing With Selenium
Web App Testing With SeleniumWeb App Testing With Selenium
Web App Testing With Selenium
 
Functional Testing Swing Applications with Frankenstein
Functional Testing Swing Applications with FrankensteinFunctional Testing Swing Applications with Frankenstein
Functional Testing Swing Applications with Frankenstein
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
Eclipse 40 and Eclipse e4
Eclipse 40 and Eclipse e4 Eclipse 40 and Eclipse e4
Eclipse 40 and Eclipse e4
 
Eclipse e4 on Java Forum Stuttgart 2010
Eclipse e4 on Java Forum Stuttgart 2010Eclipse e4 on Java Forum Stuttgart 2010
Eclipse e4 on Java Forum Stuttgart 2010
 
Selenium
SeleniumSelenium
Selenium
 
Susan windsor soft test 16th november 2005
Susan windsor soft test   16th november 2005Susan windsor soft test   16th november 2005
Susan windsor soft test 16th november 2005
 
Javazone 2010-lift-framework-public
Javazone 2010-lift-framework-publicJavazone 2010-lift-framework-public
Javazone 2010-lift-framework-public
 
Interview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlotInterview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlot
 
Testing Ajax Web Applications
Testing Ajax Web ApplicationsTesting Ajax Web Applications
Testing Ajax Web Applications
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSF
 
Improving code quality using CI
Improving code quality using CIImproving code quality using CI
Improving code quality using CI
 
Struts2
Struts2Struts2
Struts2
 
Automated Testing Of Web Applications Using XML
Automated  Testing Of  Web  Applications Using  XMLAutomated  Testing Of  Web  Applications Using  XML
Automated Testing Of Web Applications Using XML
 
About Qtp_1 92
About Qtp_1 92About Qtp_1 92
About Qtp_1 92
 
About QTP 9.2
About QTP 9.2About QTP 9.2
About QTP 9.2
 
About Qtp 92
About Qtp 92About Qtp 92
About Qtp 92
 

More from Pyxis Technologies

Pitié, ne construisez pas le nouveau pont Champlain en Agilité...
Pitié, ne construisez pas le nouveau pont Champlain en Agilité...Pitié, ne construisez pas le nouveau pont Champlain en Agilité...
Pitié, ne construisez pas le nouveau pont Champlain en Agilité...
Pyxis Technologies
 
Sorry, the new Champlain Bridge can’t be built using Agile...
Sorry, the new Champlain Bridge can’t be built using Agile...Sorry, the new Champlain Bridge can’t be built using Agile...
Sorry, the new Champlain Bridge can’t be built using Agile...
Pyxis Technologies
 
Développer votre logiciel interne : comment y parvenir sans investir une fort...
Développer votre logiciel interne : comment y parvenir sans investir une fort...Développer votre logiciel interne : comment y parvenir sans investir une fort...
Développer votre logiciel interne : comment y parvenir sans investir une fort...
Pyxis Technologies
 
Agilité du point de vue de la gouvernance
Agilité du point de vue de la gouvernanceAgilité du point de vue de la gouvernance
Agilité du point de vue de la gouvernance
Pyxis Technologies
 
La gestion de portefeuille Agile - c'est pas compliqué!
La gestion de portefeuille Agile - c'est pas compliqué! La gestion de portefeuille Agile - c'est pas compliqué!
La gestion de portefeuille Agile - c'est pas compliqué!
Pyxis Technologies
 
Introduction à Agile Lean
Introduction à Agile LeanIntroduction à Agile Lean
Introduction à Agile Lean
Pyxis Technologies
 
La valeur d'affaires comme indicateur de la gestion de projet - IIBA Montréal...
La valeur d'affaires comme indicateur de la gestion de projet - IIBA Montréal...La valeur d'affaires comme indicateur de la gestion de projet - IIBA Montréal...
La valeur d'affaires comme indicateur de la gestion de projet - IIBA Montréal...
Pyxis Technologies
 
Agile BA - catalyseur, createur de valeur - BAFS 29 juin 2015 Geneve
Agile BA - catalyseur, createur de valeur - BAFS 29 juin 2015 Geneve Agile BA - catalyseur, createur de valeur - BAFS 29 juin 2015 Geneve
Agile BA - catalyseur, createur de valeur - BAFS 29 juin 2015 Geneve
Pyxis Technologies
 
Estimation initiale dun projet agile de Mathieu Boisvert
Estimation initiale dun projet agile de Mathieu BoisvertEstimation initiale dun projet agile de Mathieu Boisvert
Estimation initiale dun projet agile de Mathieu Boisvert
Pyxis Technologies
 
Les attitudes doxiques dans les équipes et le syndrome du Titanic!
Les attitudes doxiques dans les équipes et le syndrome du Titanic!Les attitudes doxiques dans les équipes et le syndrome du Titanic!
Les attitudes doxiques dans les équipes et le syndrome du Titanic!
Pyxis Technologies
 
La valeur d’affaires: L’indicateur qui peut changer le succès des projets
La valeur d’affaires: L’indicateur qui peut changer le succès des projetsLa valeur d’affaires: L’indicateur qui peut changer le succès des projets
La valeur d’affaires: L’indicateur qui peut changer le succès des projets
Pyxis Technologies
 
Le rôle de l’architecte Agile - Mathieu Boisvert
Le rôle de l’architecte Agile - Mathieu BoisvertLe rôle de l’architecte Agile - Mathieu Boisvert
Le rôle de l’architecte Agile - Mathieu Boisvert
Pyxis Technologies
 
Agilité et la gestion du changement mboisvert - 15 octobre 2013
Agilité et la gestion du changement   mboisvert - 15 octobre 2013Agilité et la gestion du changement   mboisvert - 15 octobre 2013
Agilité et la gestion du changement mboisvert - 15 octobre 2013
Pyxis Technologies
 
Comment être agile dans un contexte non lié aux TI ?
Comment être agile dans un contexte non lié aux TI ?Comment être agile dans un contexte non lié aux TI ?
Comment être agile dans un contexte non lié aux TI ?
Pyxis Technologies
 
La revue d'itération intégrée… Et autres fabuleuses pratiques Agiles adaptées...
La revue d'itération intégrée… Et autres fabuleuses pratiques Agiles adaptées...La revue d'itération intégrée… Et autres fabuleuses pratiques Agiles adaptées...
La revue d'itération intégrée… Et autres fabuleuses pratiques Agiles adaptées...
Pyxis Technologies
 
Choisir ses priorités: le développement incrémental de produit
Choisir ses priorités: le développement incrémental de produitChoisir ses priorités: le développement incrémental de produit
Choisir ses priorités: le développement incrémental de produit
Pyxis Technologies
 
Apprendre pour la performance et le bien-être
Apprendre pour la performance et le bien-êtreApprendre pour la performance et le bien-être
Apprendre pour la performance et le bien-êtrePyxis Technologies
 
L'agilité : de l'individu à l'organisation en passant par l'équipe
L'agilité : de l'individu à l'organisation en passant par l'équipeL'agilité : de l'individu à l'organisation en passant par l'équipe
L'agilité : de l'individu à l'organisation en passant par l'équipe
Pyxis Technologies
 
Agile du point de vue d'un PMP
Agile du point de vue d'un PMPAgile du point de vue d'un PMP
Agile du point de vue d'un PMP
Pyxis Technologies
 

More from Pyxis Technologies (20)

Pitié, ne construisez pas le nouveau pont Champlain en Agilité...
Pitié, ne construisez pas le nouveau pont Champlain en Agilité...Pitié, ne construisez pas le nouveau pont Champlain en Agilité...
Pitié, ne construisez pas le nouveau pont Champlain en Agilité...
 
Sorry, the new Champlain Bridge can’t be built using Agile...
Sorry, the new Champlain Bridge can’t be built using Agile...Sorry, the new Champlain Bridge can’t be built using Agile...
Sorry, the new Champlain Bridge can’t be built using Agile...
 
Développer votre logiciel interne : comment y parvenir sans investir une fort...
Développer votre logiciel interne : comment y parvenir sans investir une fort...Développer votre logiciel interne : comment y parvenir sans investir une fort...
Développer votre logiciel interne : comment y parvenir sans investir une fort...
 
Agilité du point de vue de la gouvernance
Agilité du point de vue de la gouvernanceAgilité du point de vue de la gouvernance
Agilité du point de vue de la gouvernance
 
La gestion de portefeuille Agile - c'est pas compliqué!
La gestion de portefeuille Agile - c'est pas compliqué! La gestion de portefeuille Agile - c'est pas compliqué!
La gestion de portefeuille Agile - c'est pas compliqué!
 
Introduction à Agile Lean
Introduction à Agile LeanIntroduction à Agile Lean
Introduction à Agile Lean
 
La valeur d'affaires comme indicateur de la gestion de projet - IIBA Montréal...
La valeur d'affaires comme indicateur de la gestion de projet - IIBA Montréal...La valeur d'affaires comme indicateur de la gestion de projet - IIBA Montréal...
La valeur d'affaires comme indicateur de la gestion de projet - IIBA Montréal...
 
Agile BA - catalyseur, createur de valeur - BAFS 29 juin 2015 Geneve
Agile BA - catalyseur, createur de valeur - BAFS 29 juin 2015 Geneve Agile BA - catalyseur, createur de valeur - BAFS 29 juin 2015 Geneve
Agile BA - catalyseur, createur de valeur - BAFS 29 juin 2015 Geneve
 
Estimation initiale dun projet agile de Mathieu Boisvert
Estimation initiale dun projet agile de Mathieu BoisvertEstimation initiale dun projet agile de Mathieu Boisvert
Estimation initiale dun projet agile de Mathieu Boisvert
 
Les attitudes doxiques dans les équipes et le syndrome du Titanic!
Les attitudes doxiques dans les équipes et le syndrome du Titanic!Les attitudes doxiques dans les équipes et le syndrome du Titanic!
Les attitudes doxiques dans les équipes et le syndrome du Titanic!
 
La valeur d’affaires: L’indicateur qui peut changer le succès des projets
La valeur d’affaires: L’indicateur qui peut changer le succès des projetsLa valeur d’affaires: L’indicateur qui peut changer le succès des projets
La valeur d’affaires: L’indicateur qui peut changer le succès des projets
 
Danser avec les polarités
Danser avec les polaritésDanser avec les polarités
Danser avec les polarités
 
Le rôle de l’architecte Agile - Mathieu Boisvert
Le rôle de l’architecte Agile - Mathieu BoisvertLe rôle de l’architecte Agile - Mathieu Boisvert
Le rôle de l’architecte Agile - Mathieu Boisvert
 
Agilité et la gestion du changement mboisvert - 15 octobre 2013
Agilité et la gestion du changement   mboisvert - 15 octobre 2013Agilité et la gestion du changement   mboisvert - 15 octobre 2013
Agilité et la gestion du changement mboisvert - 15 octobre 2013
 
Comment être agile dans un contexte non lié aux TI ?
Comment être agile dans un contexte non lié aux TI ?Comment être agile dans un contexte non lié aux TI ?
Comment être agile dans un contexte non lié aux TI ?
 
La revue d'itération intégrée… Et autres fabuleuses pratiques Agiles adaptées...
La revue d'itération intégrée… Et autres fabuleuses pratiques Agiles adaptées...La revue d'itération intégrée… Et autres fabuleuses pratiques Agiles adaptées...
La revue d'itération intégrée… Et autres fabuleuses pratiques Agiles adaptées...
 
Choisir ses priorités: le développement incrémental de produit
Choisir ses priorités: le développement incrémental de produitChoisir ses priorités: le développement incrémental de produit
Choisir ses priorités: le développement incrémental de produit
 
Apprendre pour la performance et le bien-être
Apprendre pour la performance et le bien-êtreApprendre pour la performance et le bien-être
Apprendre pour la performance et le bien-être
 
L'agilité : de l'individu à l'organisation en passant par l'équipe
L'agilité : de l'individu à l'organisation en passant par l'équipeL'agilité : de l'individu à l'organisation en passant par l'équipe
L'agilité : de l'individu à l'organisation en passant par l'équipe
 
Agile du point de vue d'un PMP
Agile du point de vue d'un PMPAgile du point de vue d'un PMP
Agile du point de vue d'un PMP
 

Recently uploaded

Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 

Recently uploaded (20)

Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 

FluentSelenium Presentation Code Camp09

  • 1. Les DSL et &quot;fluent interface&quot; pour les tests ASP.NET avec Selenium FluentSelenium
  • 2.
  • 6.
  • 7. Here's a web test written with selenium selenium.Open( &quot;Forum/AllPosts.aspx&quot; ); selenium.WaitForPageToLoad( &quot;8000&quot; ); selenium.Click( &quot;newPost&quot; ); selenium.WaitForPageToLoad( &quot;8000&quot; ); selenium.Type( &quot;//*[contains(@id, 'txtAuthor')]&quot; , &quot;Luc&quot; ); selenium.Type( &quot;//*[contains(@id, 'txtSubject')]&quot; , &quot;Simple example of the library.&quot; ); selenium.Click( &quot;//*[contains(@id, 'btnSavePost')]&quot; ); selenium.WaitForPageToLoad( &quot;8000&quot; ); Assert .AreEqual( &quot;Luc&quot; , selenium.GetText( &quot;//table[contains(@id, 'grdPosts')]//tr[2]/td[2]&quot; ));
  • 8. Xpath introduction XPath is a structred XML query language Example : get the node of the employee with ID 123456 Employees/Employee[@EmployeeID='123456'] < Employees > < Employee EmployeeID = &quot; 123456 &quot; > < LastName > Laporte </ LastName > < FirstName > Jacques </ FirstName > </ Employee > < Employee EmployeeID = &quot; 654321 &quot; > < LastName > Gendron </ LastName > < FirstName > Pierre </ FirstName > </ Employee > </ Employees >
  • 9. Xpath introduction XPath is a structred XML query language Example : get the last name of the employee with ID 123456 : Employees/Employee[@EmployeeID='123456']/LastName < Employees > < Employee EmployeeID = &quot; 123456 &quot; > < LastName > Laporte </ LastName > < FirstName > Jacques </ FirstName > </ Employee > < Employee EmployeeID = &quot; 654321 &quot; > < LastName > Gendron </ LastName > < FirstName > Pierre </ FirstName > </ Employee > </ Employees >
  • 10. Selenium and XPath on HTML Because HTML is an XML derivative, XPath can be used to locate nodes in a HTML web page Example : ask selenium to click on the Save button : selenium.Click(“//input[@id='btnSubmit']”); selenium.WaitForPageToLoad(“5000”); < html > < body > < form > < div >Hello World !</ div > < input type = &quot; submit &quot; value = &quot; Save &quot; id = &quot; btnSubmit &quot; /> </ form > </ body > </ html >
  • 11. Complete simple web test with selenium
  • 12.
  • 15.
  • 18. Test coverage Should we aim for 100% coverage?
  • 20. What does this mean? Integrated tests Unit tests Test coverage
  • 21.
  • 22. Favor coverage through testing of services and domain objects over UI testing
  • 23. Use patterns that facilitate testing close to the UI layer such as MVC
  • 24. Aim for coverage that gives you confidence in the quality of your deliverables
  • 25.
  • 26. They will be easier to read
  • 27. They will not be impacted by updates in other tests
  • 28.
  • 29.
  • 30.
  • 31. Tests are code also. Team code quality rules should also be applied to tests.
  • 32. XPATH is dangerous, use it wisely Use ID-based queries when possible //*[@id = 'searchResultCount']
  • 33. Avoid exessive XPATH steps When requiring further qualification in searches only add necessary qualifiers Favor //*[@id='searchResults']//li[1] Over /html/body//div[@id='searchResults']/ul/li[1]
  • 34. XPATH queries are not clear Xpath expressions are the kind of literal who's meaning can be hard to decipher. Use constants. Favor selenium.GetText(SearchResultSummaryLocator); Over selenium.GetText( &quot;//*[@id='searchResultsSummary']&quot; );
  • 35.
  • 36. Hard to read tests are hard maintain
  • 37. Tests serve as application behavior documentation
  • 38.
  • 39.
  • 40. Users
  • 42. Technical writers Write tests in your audiences language!
  • 43.
  • 44.
  • 45. Nhibernate and Linq use query oriented languages
  • 46. Users speak in the language of their needs and tasks
  • 47. Programmers tend to speak in terms of technical jargon In code this translates to the choice vocabulary used in class, method and variable names. Tests should use a DSL appropriate to the end user.
  • 48.
  • 49.
  • 52. Some examples shopper.Goto( &quot;Shopping/ShopOnline.aspx&quot; ); shopper.For(WelcomeMessageBox).ShouldSee( &quot;Welcome to Shop-e online!&quot; ); shopper.ShouldSee(FeaturedProductArea); shopper.For(FeaturedProductTitle).ShouldSee( &quot;blank CDs (10)&quot; ); shopper.For(FeaturedProductUnitePriceField).ShouldSee( &quot;5.00$&quot; );
  • 53. selenium.Open( &quot;Shopping/ShopOnline.aspx&quot; ); selenium.WaitForPageToLoad( &quot;1000&quot; ); Assert .AreEqual( &quot;Welcome to Shop-e online!&quot; , selenium.GetText( &quot;welcome&quot; )); Assert .IsTrue(selenium.IsVisible( &quot;featuredProduct&quot; )); Assert .AreEqual( &quot;blank CDs (10)&quot; , selenium.GetText( &quot;//*[@id='featuredProduct']//*[@id='title']&quot; )); Assert .AreEqual( &quot;5,00$&quot; , selenium.GetText( &quot;//*[@id='featuredProduct']//*[@id='price']&quot; ));
  • 54. ... forumUser.Goto( &quot;Forum/AllPosts.aspx&quot; ); forumUser.For(addPostButton).Clicks(); forumUser.WaitFor(newPostPageLoadWait); forumUser.For(subjectTextBox).Enters( &quot;Simple example of the library.&quot; ); forumUser.For(messagetTextBox).Enters( &quot;blah&quot; ); forumUser.For(savePostButton).Clicks(); forumUser.For(authorRequiredMessage).ShouldSee( &quot;The author is required.&quot; );
  • 55. The User The User class is the root of the DSL. All web test operations spawn from it. It is initialized as follows: var selenium = new DefaultSelenium (....); var forumUser = new User (selenium); Variables of type User should be named according to the role of the application user.
  • 56. Pushing XPATH out of the tests FluentSelenium uses typed locator objects ElementLocator WelcomeMessageBox = ElementLocator .WithId( &quot;welcome&quot; ); InputLocator SearchCatalogText = InputLocator .WithId( &quot;searchText&quot; ); ButtonLocator SearchCatalogButton = ButtonLocator .WithId( &quot;searchButton&quot; ); ElementLocator FeaturedProductTitle = ElementLocator .WithXpath( &quot;//*[@id='featuredProduct']//*[@id='title']&quot; ); Locator types determine what operations are available with a “For” shopper.For(SearchCatalogText).Enters( &quot;mouse&quot; ); shopper.For(SearchCatalogButton).Clicks();
  • 57. Application navigation Navigating to a specific address: goto shopper.Goto( &quot;Shopping/ShopOnline.aspx&quot; ); Navigating by clicking on links and buttons: click shopper.For(DiscountsButton).Clicks(); Waiting for page loading: WaitFor PageLoadWaitCondition SearchResultPageLoad = PageLoadWaitCondition .For( &quot;Shopping/SearchResults.aspx&quot; ); shopper.WaitFor(SearchResultPageLoad); Waiting for special conditions can be done by writing a custom implementation of IWaitCondition
  • 58. Validating page content Presence or absence of an element shopper.ShouldSee(WelcomeMessageBox); shopper.ShouldNotSee(SearchResults); Content of an page element shopper.For(SearchResultsSummary).ShouldSee( &quot;1 match found&quot; ); Custom validation, any implementation of IContentValidator class AnyNumberValidator : IContentValidator { public void Validate( ContentTester contentTester) .... shopper.For(OrderNumber).ShouldSee(AnyNumber);
  • 59. Testing table content Testing the content of a table row f orumUser.For(allPostsTable).Row(2).ShouldSee( &quot;Luc&quot; , &quot;Hello&quot; ); Jim Nothing Luc Hello Bob Goodbye Testing the content of a table column forumUser.For(allPostsTable).Column(1).ShouldSee( &quot;Jim&quot;, &quot;Luc&quot;, “Bob” ); Jim Nothing Luc Hello Bob Goodbye
  • 60. Other table operations Checking cell content forumUser.For(allPostsTable).Row(2).Column(3).ShouldSee( &quot;Present&quot; ); Cells have content forumUser.For(allPostsTable).Row(2).Column(3).For(replyPostButton).Click();
  • 61.
  • 62.
  • 63. Use extension methods to add test methods to the User class
  • 64.
  • 66.
  • 67.
  • 68. A simplified spin off of a framework developed for one of our clients. We expect to extend it with ideas and concepts that aren't yet implemented
  • 69. A work in progress
  • 70. A facilitator, not a solution
  • 71.