SlideShare a Scribd company logo
Behavior Driven
Web UI Automation
with Selenium and
Cucumber/SpecFlow
Agile Testing Days 2017, Potsdam
16th November, 2017
Gáspár Nagy
coach • trainer • bdd addict • creator of specflow
“The BDD Books: Discovery” • http://bddbooks.com
@gasparnagy • gaspar@specsolutions.eu
Copyright © Gaspar NagyCopyright © Gaspar Nagy
bdd addict
given.when.then
CAUTION!
on the stage
Gáspár Nagy
coach, trainer and bdd addict
creator of SpecFlow
gaspar@specsolutions.eu
https://specsolutions.eu
@gasparnagy
Copyright © Gaspar NagyCopyright © Gaspar Nagy
There are problems with UI test automation!
script
expressed using
UI terms
modeling gap
between UI terms and
domain model terms
sloooow
for a bigger app the
feedback loop gets
uselessly long
brittle
browsers changing,
environment changes,
cross-platform issues,
etc.
Copyright © Gaspar NagyCopyright © Gaspar Nagy
You are here*!
*hopefully
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Unclear
purpose
Code
duplication
Anti-
semantic
locators
Wrong
abstraction
Timing
issues
Behavior Driven UI Automation (Agile Testing Days 2017, Potsdam)
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Unclear
purpose
Code
duplication
Anti-
semantic
locators
Wrong
abstraction
Timing
issues
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Unclear purpose – What does it do?
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Introduce BDD (SpecFlow/Cucumber)
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Unclear
purpose
Code
duplication
Anti-
semantic
locators
Wrong
abstraction
Timing
issues
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Introduce Page Objects
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Introduce Page Objects
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Introduce Page Objects
Encapsulate interactions
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Unclear
purpose
Code
duplication
Anti-
semantic
locators
Wrong
abstraction
Timing
issues
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Anti-semantic locators
• Think about how your users identify the different information (text, data,
controls, buttons, etc.) on the page
• If the user can find them, you will also find them… be smart!
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Locating by ID is not enough!
[FindsBy(How = How.Id, Using = "cb9eb8be-71…")]
public IWebElement Khaki { get; set; }
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Do not expose internals in the locators!
[FindsBy(How = How.Id, Using = "fabric_input")]
public IWebElement Fabric { get; set; }
fabric
fabric_input
fabric_list
fabric_open
@Html.Kendo().ComboBox().Name("fabric")
These are
internal for
the control!
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Contextual semantics
[FindsBy(How = How.CssSelector, Using = "input.btn.btn-default")]
public IWebElement SubmitButton { get; set; }
The page may contain multiple forms later!
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Define your own location strategy and
implement it as a custom locator!
[FindsBy(How = How.Custom,
CustomFinderType = typeof(TableFieldLocator)]
public IWebElement UserName { get; set; }
form
This is a
generic lookup
strategy
User Name
Password
input
input
Copyright © Gaspar NagyCopyright © Gaspar Nagy
public IWebElement UserName { get; set; }
Apply conventions with decorators and find the
tester’s nirvana…
form
This is the app-
specific lookup
strategy
User Name
Password
input
input
Behavior Driven UI Automation (Agile Testing Days 2017, Potsdam)
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Unclear
purpose
Code
duplication
Anti-
semantic
locators
Wrong
abstraction
Timing
issues
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Wrong abstraction
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Concept is an idea or mental picture of a group or
class of objects formed by combining all their aspects
This
gonna
save it!
Copyright © Gaspar NagyCopyright © Gaspar Nagy
UI Concepts
Counter concept,
divs and spans
Short-text entering
concept, input
@type=text
Multi-line text
entering concept,
div+javascriptSingle-choice concept,
set of input
@type=radio Submit concept,
span+javascript
Copyright © Gaspar NagyCopyright © Gaspar Nagy
A concept-based page
express concepts
interact on concept
level
For ConceptFactory implementation see:
https://github.com/gasparnagy/Sample_BehaviorDrivenWebUIAutomation
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Unclear
purpose
Code
duplication
Anti-
semantic
locators
Wrong
abstraction
Timing
issues
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Thread.Sleep(3000);
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Why do we have this timing problem?
Copyright © Gaspar NagyCopyright © Gaspar Nagy
An example
Enter text
Post form
Working, working…
Observe result
title.SendKeys(…);
button.Click();
driver.FindElement(…);
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Let’s add some waiting to it!
Thread.Sleep(2000);
var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5));
wait.Until(d => d.FindElement(By...));
driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));
...
driver.FindElement(By...);
Static waiting
Busy/active waiting
Implicit busy waiting
Copyright © Gaspar NagyCopyright © Gaspar Nagy
An example
Enter text
Post form
Working, working…
Observe result
title.SendKeys(…);
button.Click();
driver.FindElement(…);
The thing you are waiting for is here!
You are waiting here!
Your user knows* when the action is done
*hopefully
• Maybe there is a progress indicator
• Maybe they look at the browser icon
• Maybe they’ll wait till they see the end of the page
Copyright © Gaspar NagyCopyright © Gaspar Nagy
An example
Enter text
Post form
Working, working…
Observe result
title.SendKeys(…);
button.Click();
...wait for the footer
driver.FindElement(…);
Result page loaded
button.SubmitClick()
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Other conditions
• Wait until progress indicator is unloaded
• Wait until injected JavaScript signals that the operation has finished
• Wait until protractor signals
• You can even put Thread.Sleep there… only to that single place!
For all these, you need to isolate Submit/Click from other clicks
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Unclear
purpose
Code
duplication
Anti-
semantic
locators
Wrong
abstraction
Timing
issues
Behavior Driven UI Automation (Agile Testing Days 2017, Potsdam)
*maybe
Thank you!
Gáspár Nagy
coach • trainer • bdd addict • creator of specflow
“The BDD Books: Discovery” • http://bddbooks.com
@gasparnagy • gaspar@specsolutions.eu
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Ad

More Related Content

Viewers also liked (8)

UI Test Automation Effectiveness
UI Test Automation EffectivenessUI Test Automation Effectiveness
UI Test Automation Effectiveness
SQALab
 
Coded UI - Test automation Practices from the Field
Coded UI - Test automation Practices from the FieldCoded UI - Test automation Practices from the Field
Coded UI - Test automation Practices from the Field
Clemens Reijnen
 
Introduction to UI Automation Framework
Introduction to UI Automation FrameworkIntroduction to UI Automation Framework
Introduction to UI Automation Framework
Priya Rajagopal
 
Effectively Using UI Automation
Effectively Using UI AutomationEffectively Using UI Automation
Effectively Using UI Automation
Alexander Repty
 
Web UI test automation instruments
Web UI test automation instrumentsWeb UI test automation instruments
Web UI test automation instruments
Artem Nagornyi
 
UI test automation techniques by an example of JavaFX UI
UI test automation techniques by an example of JavaFX UIUI test automation techniques by an example of JavaFX UI
UI test automation techniques by an example of JavaFX UI
yaevents
 
UI Test Automation - Maximizing ROI by Minimizing Maintenance Costs
UI Test Automation - Maximizing ROI by Minimizing Maintenance CostsUI Test Automation - Maximizing ROI by Minimizing Maintenance Costs
UI Test Automation - Maximizing ROI by Minimizing Maintenance Costs
🐾 Jim Sibley 🐾
 
Challenges faced in UI automation
Challenges faced in UI automationChallenges faced in UI automation
Challenges faced in UI automation
Srinivas Kantipudi
 
UI Test Automation Effectiveness
UI Test Automation EffectivenessUI Test Automation Effectiveness
UI Test Automation Effectiveness
SQALab
 
Coded UI - Test automation Practices from the Field
Coded UI - Test automation Practices from the FieldCoded UI - Test automation Practices from the Field
Coded UI - Test automation Practices from the Field
Clemens Reijnen
 
Introduction to UI Automation Framework
Introduction to UI Automation FrameworkIntroduction to UI Automation Framework
Introduction to UI Automation Framework
Priya Rajagopal
 
Effectively Using UI Automation
Effectively Using UI AutomationEffectively Using UI Automation
Effectively Using UI Automation
Alexander Repty
 
Web UI test automation instruments
Web UI test automation instrumentsWeb UI test automation instruments
Web UI test automation instruments
Artem Nagornyi
 
UI test automation techniques by an example of JavaFX UI
UI test automation techniques by an example of JavaFX UIUI test automation techniques by an example of JavaFX UI
UI test automation techniques by an example of JavaFX UI
yaevents
 
UI Test Automation - Maximizing ROI by Minimizing Maintenance Costs
UI Test Automation - Maximizing ROI by Minimizing Maintenance CostsUI Test Automation - Maximizing ROI by Minimizing Maintenance Costs
UI Test Automation - Maximizing ROI by Minimizing Maintenance Costs
🐾 Jim Sibley 🐾
 
Challenges faced in UI automation
Challenges faced in UI automationChallenges faced in UI automation
Challenges faced in UI automation
Srinivas Kantipudi
 

Similar to Behavior Driven UI Automation (Agile Testing Days 2017, Potsdam) (20)

Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
Gáspár Nagy
 
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Gáspár Nagy
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code
維佋 唐
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
Guillaume Laforge
 
Automatic Code Generation
Automatic Code GenerationAutomatic Code Generation
Automatic Code Generation
elliando dias
 
Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)
Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)
Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)
Gáspár Nagy
 
Intro To Django
Intro To DjangoIntro To Django
Intro To Django
Udi Bauman
 
Html5 Overview
Html5 OverviewHtml5 Overview
Html5 Overview
Abdel Moneim Emad
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007
Tugdual Grall
 
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (HUSTEF 2...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (HUSTEF 2...Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (HUSTEF 2...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (HUSTEF 2...
Gáspár Nagy
 
JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...
JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...
JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...
Yusuke Yamamoto
 
Introduction to Spring Boot.pdf
Introduction to Spring Boot.pdfIntroduction to Spring Boot.pdf
Introduction to Spring Boot.pdf
ShaiAlmog1
 
Google Gears
Google GearsGoogle Gears
Google Gears
silenceIT Inc.
 
Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007
Guillaume Laforge
 
How to build unified Batch & Streaming Pipelines with Apache Beam and Dataflow
How to build unified Batch & Streaming Pipelines with Apache Beam and DataflowHow to build unified Batch & Streaming Pipelines with Apache Beam and Dataflow
How to build unified Batch & Streaming Pipelines with Apache Beam and Dataflow
Daniel Zivkovic
 
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume LaforgeGroovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Guillaume Laforge
 
"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson
GWTcon
 
Creative Solutions to Already Solved Problems II
Creative Solutions to Already Solved Problems IICreative Solutions to Already Solved Problems II
Creative Solutions to Already Solved Problems II
Gene Gotimer
 
Boost your testing: End-to-End with Docker and Geb
 Boost your testing: End-to-End with Docker and Geb Boost your testing: End-to-End with Docker and Geb
Boost your testing: End-to-End with Docker and Geb
Markus Schlichting
 
IBIS - Intelligent Band Information System
IBIS - Intelligent Band Information SystemIBIS - Intelligent Band Information System
IBIS - Intelligent Band Information System
Micron
 
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
Gáspár Nagy
 
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Gáspár Nagy
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code
維佋 唐
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
Guillaume Laforge
 
Automatic Code Generation
Automatic Code GenerationAutomatic Code Generation
Automatic Code Generation
elliando dias
 
Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)
Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)
Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)
Gáspár Nagy
 
Intro To Django
Intro To DjangoIntro To Django
Intro To Django
Udi Bauman
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007
Tugdual Grall
 
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (HUSTEF 2...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (HUSTEF 2...Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (HUSTEF 2...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (HUSTEF 2...
Gáspár Nagy
 
JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...
JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...
JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...
Yusuke Yamamoto
 
Introduction to Spring Boot.pdf
Introduction to Spring Boot.pdfIntroduction to Spring Boot.pdf
Introduction to Spring Boot.pdf
ShaiAlmog1
 
Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007
Guillaume Laforge
 
How to build unified Batch & Streaming Pipelines with Apache Beam and Dataflow
How to build unified Batch & Streaming Pipelines with Apache Beam and DataflowHow to build unified Batch & Streaming Pipelines with Apache Beam and Dataflow
How to build unified Batch & Streaming Pipelines with Apache Beam and Dataflow
Daniel Zivkovic
 
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume LaforgeGroovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Guillaume Laforge
 
"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson
GWTcon
 
Creative Solutions to Already Solved Problems II
Creative Solutions to Already Solved Problems IICreative Solutions to Already Solved Problems II
Creative Solutions to Already Solved Problems II
Gene Gotimer
 
Boost your testing: End-to-End with Docker and Geb
 Boost your testing: End-to-End with Docker and Geb Boost your testing: End-to-End with Docker and Geb
Boost your testing: End-to-End with Docker and Geb
Markus Schlichting
 
IBIS - Intelligent Band Information System
IBIS - Intelligent Band Information SystemIBIS - Intelligent Band Information System
IBIS - Intelligent Band Information System
Micron
 
Ad

More from Gáspár Nagy (16)

Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Gáspár Nagy
 
BDD Scenarios in a Testing Strategy
BDD Scenarios in a Testing StrategyBDD Scenarios in a Testing Strategy
BDD Scenarios in a Testing Strategy
Gáspár Nagy
 
Ramp up your testing solution, ExpoQA 2023
Ramp up your testing solution, ExpoQA 2023Ramp up your testing solution, ExpoQA 2023
Ramp up your testing solution, ExpoQA 2023
Gáspár Nagy
 
BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)
BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)
BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)
Gáspár Nagy
 
Fighting against technical debt (CukenFest 2020)
Fighting against technical debt (CukenFest 2020)Fighting against technical debt (CukenFest 2020)
Fighting against technical debt (CukenFest 2020)
Gáspár Nagy
 
Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...
Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...
Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...
Gáspár Nagy
 
Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...
Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...
Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...
Gáspár Nagy
 
We are sinking: Hitting the testing iceberg (CukenFest London, 2018)
We are sinking: Hitting the testing iceberg (CukenFest London, 2018)We are sinking: Hitting the testing iceberg (CukenFest London, 2018)
We are sinking: Hitting the testing iceberg (CukenFest London, 2018)
Gáspár Nagy
 
Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)
Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)
Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)
Gáspár Nagy
 
A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...
A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...
A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...
Gáspár Nagy
 
Property Based BDD Examples (ETSI UCAAT 2016, Budapest)
Property Based BDD Examples (ETSI UCAAT 2016, Budapest)Property Based BDD Examples (ETSI UCAAT 2016, Budapest)
Property Based BDD Examples (ETSI UCAAT 2016, Budapest)
Gáspár Nagy
 
Given/When/Then-ready sprint planning with Example Mapping (Agilia Budapest 2...
Given/When/Then-ready sprint planning with Example Mapping (Agilia Budapest 2...Given/When/Then-ready sprint planning with Example Mapping (Agilia Budapest 2...
Given/When/Then-ready sprint planning with Example Mapping (Agilia Budapest 2...
Gáspár Nagy
 
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Gáspár Nagy
 
Introducing BDD to Legacy Applications with SpecFlow/Cucumber (Agilia Confere...
Introducing BDD to Legacy Applications with SpecFlow/Cucumber (Agilia Confere...Introducing BDD to Legacy Applications with SpecFlow/Cucumber (Agilia Confere...
Introducing BDD to Legacy Applications with SpecFlow/Cucumber (Agilia Confere...
Gáspár Nagy
 
Folyamatos integráció és kódépítés (ALM Day Budapest, 24/11/2015, Hungarian)
Folyamatos integráció és kódépítés (ALM Day Budapest, 24/11/2015, Hungarian)Folyamatos integráció és kódépítés (ALM Day Budapest, 24/11/2015, Hungarian)
Folyamatos integráció és kódépítés (ALM Day Budapest, 24/11/2015, Hungarian)
Gáspár Nagy
 
Given/When/Then-ready sprint planning (Agile Tour Vienna 2015)
Given/When/Then-ready sprint planning (Agile Tour Vienna 2015)Given/When/Then-ready sprint planning (Agile Tour Vienna 2015)
Given/When/Then-ready sprint planning (Agile Tour Vienna 2015)
Gáspár Nagy
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Gáspár Nagy
 
BDD Scenarios in a Testing Strategy
BDD Scenarios in a Testing StrategyBDD Scenarios in a Testing Strategy
BDD Scenarios in a Testing Strategy
Gáspár Nagy
 
Ramp up your testing solution, ExpoQA 2023
Ramp up your testing solution, ExpoQA 2023Ramp up your testing solution, ExpoQA 2023
Ramp up your testing solution, ExpoQA 2023
Gáspár Nagy
 
BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)
BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)
BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)
Gáspár Nagy
 
Fighting against technical debt (CukenFest 2020)
Fighting against technical debt (CukenFest 2020)Fighting against technical debt (CukenFest 2020)
Fighting against technical debt (CukenFest 2020)
Gáspár Nagy
 
Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...
Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...
Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...
Gáspár Nagy
 
Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...
Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...
Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...
Gáspár Nagy
 
We are sinking: Hitting the testing iceberg (CukenFest London, 2018)
We are sinking: Hitting the testing iceberg (CukenFest London, 2018)We are sinking: Hitting the testing iceberg (CukenFest London, 2018)
We are sinking: Hitting the testing iceberg (CukenFest London, 2018)
Gáspár Nagy
 
Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)
Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)
Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)
Gáspár Nagy
 
A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...
A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...
A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...
Gáspár Nagy
 
Property Based BDD Examples (ETSI UCAAT 2016, Budapest)
Property Based BDD Examples (ETSI UCAAT 2016, Budapest)Property Based BDD Examples (ETSI UCAAT 2016, Budapest)
Property Based BDD Examples (ETSI UCAAT 2016, Budapest)
Gáspár Nagy
 
Given/When/Then-ready sprint planning with Example Mapping (Agilia Budapest 2...
Given/When/Then-ready sprint planning with Example Mapping (Agilia Budapest 2...Given/When/Then-ready sprint planning with Example Mapping (Agilia Budapest 2...
Given/When/Then-ready sprint planning with Example Mapping (Agilia Budapest 2...
Gáspár Nagy
 
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Gáspár Nagy
 
Introducing BDD to Legacy Applications with SpecFlow/Cucumber (Agilia Confere...
Introducing BDD to Legacy Applications with SpecFlow/Cucumber (Agilia Confere...Introducing BDD to Legacy Applications with SpecFlow/Cucumber (Agilia Confere...
Introducing BDD to Legacy Applications with SpecFlow/Cucumber (Agilia Confere...
Gáspár Nagy
 
Folyamatos integráció és kódépítés (ALM Day Budapest, 24/11/2015, Hungarian)
Folyamatos integráció és kódépítés (ALM Day Budapest, 24/11/2015, Hungarian)Folyamatos integráció és kódépítés (ALM Day Budapest, 24/11/2015, Hungarian)
Folyamatos integráció és kódépítés (ALM Day Budapest, 24/11/2015, Hungarian)
Gáspár Nagy
 
Given/When/Then-ready sprint planning (Agile Tour Vienna 2015)
Given/When/Then-ready sprint planning (Agile Tour Vienna 2015)Given/When/Then-ready sprint planning (Agile Tour Vienna 2015)
Given/When/Then-ready sprint planning (Agile Tour Vienna 2015)
Gáspár Nagy
 
Ad

Recently uploaded (20)

WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Odoo ERP for Education Management to Streamline Your Education Process
Odoo ERP for Education Management to Streamline Your Education ProcessOdoo ERP for Education Management to Streamline Your Education Process
Odoo ERP for Education Management to Streamline Your Education Process
iVenture Team LLP
 
Creating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdfCreating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdf
Applitools
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
saimabibi60507
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Foundation Models for Time Series : A Survey
Foundation Models for Time Series : A SurveyFoundation Models for Time Series : A Survey
Foundation Models for Time Series : A Survey
jayanthkalyanam1
 
Innovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at allInnovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at all
ayeshakanwal75
 
Microsoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptxMicrosoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptx
Mekonnen
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Top 10 Data Cleansing Tools for 2025.pdf
Top 10 Data Cleansing Tools for 2025.pdfTop 10 Data Cleansing Tools for 2025.pdf
Top 10 Data Cleansing Tools for 2025.pdf
AffinityCore
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Odoo ERP for Education Management to Streamline Your Education Process
Odoo ERP for Education Management to Streamline Your Education ProcessOdoo ERP for Education Management to Streamline Your Education Process
Odoo ERP for Education Management to Streamline Your Education Process
iVenture Team LLP
 
Creating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdfCreating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdf
Applitools
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
saimabibi60507
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Foundation Models for Time Series : A Survey
Foundation Models for Time Series : A SurveyFoundation Models for Time Series : A Survey
Foundation Models for Time Series : A Survey
jayanthkalyanam1
 
Innovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at allInnovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at all
ayeshakanwal75
 
Microsoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptxMicrosoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptx
Mekonnen
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Top 10 Data Cleansing Tools for 2025.pdf
Top 10 Data Cleansing Tools for 2025.pdfTop 10 Data Cleansing Tools for 2025.pdf
Top 10 Data Cleansing Tools for 2025.pdf
AffinityCore
 

Behavior Driven UI Automation (Agile Testing Days 2017, Potsdam)

  • 1. Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow Agile Testing Days 2017, Potsdam 16th November, 2017 Gáspár Nagy coach • trainer • bdd addict • creator of specflow “The BDD Books: Discovery” • http://bddbooks.com @gasparnagy • [email protected]
  • 2. Copyright © Gaspar NagyCopyright © Gaspar Nagy bdd addict given.when.then CAUTION! on the stage Gáspár Nagy coach, trainer and bdd addict creator of SpecFlow [email protected] https://specsolutions.eu @gasparnagy
  • 3. Copyright © Gaspar NagyCopyright © Gaspar Nagy There are problems with UI test automation! script expressed using UI terms modeling gap between UI terms and domain model terms sloooow for a bigger app the feedback loop gets uselessly long brittle browsers changing, environment changes, cross-platform issues, etc.
  • 4. Copyright © Gaspar NagyCopyright © Gaspar Nagy You are here*! *hopefully
  • 5. Copyright © Gaspar NagyCopyright © Gaspar Nagy
  • 6. Copyright © Gaspar NagyCopyright © Gaspar Nagy Unclear purpose Code duplication Anti- semantic locators Wrong abstraction Timing issues
  • 8. Copyright © Gaspar NagyCopyright © Gaspar Nagy Unclear purpose Code duplication Anti- semantic locators Wrong abstraction Timing issues
  • 9. Copyright © Gaspar NagyCopyright © Gaspar Nagy Unclear purpose – What does it do?
  • 10. Copyright © Gaspar NagyCopyright © Gaspar Nagy Introduce BDD (SpecFlow/Cucumber)
  • 11. Copyright © Gaspar NagyCopyright © Gaspar Nagy Unclear purpose Code duplication Anti- semantic locators Wrong abstraction Timing issues
  • 12. Copyright © Gaspar NagyCopyright © Gaspar Nagy Introduce Page Objects
  • 13. Copyright © Gaspar NagyCopyright © Gaspar Nagy Introduce Page Objects
  • 14. Copyright © Gaspar NagyCopyright © Gaspar Nagy Introduce Page Objects Encapsulate interactions
  • 15. Copyright © Gaspar NagyCopyright © Gaspar Nagy Unclear purpose Code duplication Anti- semantic locators Wrong abstraction Timing issues
  • 16. Copyright © Gaspar NagyCopyright © Gaspar Nagy
  • 17. Copyright © Gaspar NagyCopyright © Gaspar Nagy Anti-semantic locators • Think about how your users identify the different information (text, data, controls, buttons, etc.) on the page • If the user can find them, you will also find them… be smart!
  • 18. Copyright © Gaspar NagyCopyright © Gaspar Nagy Locating by ID is not enough! [FindsBy(How = How.Id, Using = "cb9eb8be-71…")] public IWebElement Khaki { get; set; }
  • 19. Copyright © Gaspar NagyCopyright © Gaspar Nagy Do not expose internals in the locators! [FindsBy(How = How.Id, Using = "fabric_input")] public IWebElement Fabric { get; set; } fabric fabric_input fabric_list fabric_open @Html.Kendo().ComboBox().Name("fabric") These are internal for the control!
  • 20. Copyright © Gaspar NagyCopyright © Gaspar Nagy Contextual semantics [FindsBy(How = How.CssSelector, Using = "input.btn.btn-default")] public IWebElement SubmitButton { get; set; } The page may contain multiple forms later!
  • 21. Copyright © Gaspar NagyCopyright © Gaspar Nagy Define your own location strategy and implement it as a custom locator! [FindsBy(How = How.Custom, CustomFinderType = typeof(TableFieldLocator)] public IWebElement UserName { get; set; } form This is a generic lookup strategy User Name Password input input
  • 22. Copyright © Gaspar NagyCopyright © Gaspar Nagy public IWebElement UserName { get; set; } Apply conventions with decorators and find the tester’s nirvana… form This is the app- specific lookup strategy User Name Password input input
  • 24. Copyright © Gaspar NagyCopyright © Gaspar Nagy Unclear purpose Code duplication Anti- semantic locators Wrong abstraction Timing issues
  • 25. Copyright © Gaspar NagyCopyright © Gaspar Nagy Wrong abstraction
  • 26. Copyright © Gaspar NagyCopyright © Gaspar Nagy Concept is an idea or mental picture of a group or class of objects formed by combining all their aspects
  • 28. Copyright © Gaspar NagyCopyright © Gaspar Nagy UI Concepts Counter concept, divs and spans Short-text entering concept, input @type=text Multi-line text entering concept, div+javascriptSingle-choice concept, set of input @type=radio Submit concept, span+javascript
  • 29. Copyright © Gaspar NagyCopyright © Gaspar Nagy A concept-based page express concepts interact on concept level For ConceptFactory implementation see: https://github.com/gasparnagy/Sample_BehaviorDrivenWebUIAutomation
  • 30. Copyright © Gaspar NagyCopyright © Gaspar Nagy Unclear purpose Code duplication Anti- semantic locators Wrong abstraction Timing issues
  • 31. Copyright © Gaspar NagyCopyright © Gaspar Nagy Thread.Sleep(3000);
  • 32. Copyright © Gaspar NagyCopyright © Gaspar Nagy Why do we have this timing problem?
  • 33. Copyright © Gaspar NagyCopyright © Gaspar Nagy An example Enter text Post form Working, working… Observe result title.SendKeys(…); button.Click(); driver.FindElement(…);
  • 34. Copyright © Gaspar NagyCopyright © Gaspar Nagy Let’s add some waiting to it! Thread.Sleep(2000); var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5)); wait.Until(d => d.FindElement(By...)); driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5)); ... driver.FindElement(By...); Static waiting Busy/active waiting Implicit busy waiting
  • 35. Copyright © Gaspar NagyCopyright © Gaspar Nagy An example Enter text Post form Working, working… Observe result title.SendKeys(…); button.Click(); driver.FindElement(…); The thing you are waiting for is here! You are waiting here!
  • 36. Your user knows* when the action is done *hopefully • Maybe there is a progress indicator • Maybe they look at the browser icon • Maybe they’ll wait till they see the end of the page
  • 37. Copyright © Gaspar NagyCopyright © Gaspar Nagy An example Enter text Post form Working, working… Observe result title.SendKeys(…); button.Click(); ...wait for the footer driver.FindElement(…); Result page loaded button.SubmitClick()
  • 38. Copyright © Gaspar NagyCopyright © Gaspar Nagy Other conditions • Wait until progress indicator is unloaded • Wait until injected JavaScript signals that the operation has finished • Wait until protractor signals • You can even put Thread.Sleep there… only to that single place! For all these, you need to isolate Submit/Click from other clicks
  • 39. Copyright © Gaspar NagyCopyright © Gaspar Nagy Unclear purpose Code duplication Anti- semantic locators Wrong abstraction Timing issues
  • 42. Thank you! Gáspár Nagy coach • trainer • bdd addict • creator of specflow “The BDD Books: Discovery” • http://bddbooks.com @gasparnagy • [email protected]
  • 43. Copyright © Gaspar NagyCopyright © Gaspar Nagy