SlideShare a Scribd company logo
Fannie Mae Confidential and Proprietary
BDD With Selenide
Hima Bindu Peteti
Saucecon 2019
0
2
HIMA BINDU PETETI
Senior Software Engineer
Experienced in designing and developing large scale web
applications and designing complex test automation frameworks
using Java / JEE technologies.
Passionate about open-source automation frameworks
that provide application modeling, unit, integration, functional, and
visual testing.
Contact me at
linkedin.com/in/hima-bindu-peteti-378152a4
Agenda BDD in the context of test
automation
01
Selenium Vs Selenide02
Selenide deep dive
03
04
05
06
Additional Selenide benefits
Compare coding in Selenium and
Selenide
Design Patterns
Fannie Mae Confidential and Proprietary 3
Bridging the gap between Business and Technology
Fannie Mae Confidential and Proprietary 4
Business
Technology
BDD in the context of Test Automation
Features Examples
Executable
Specification’s
Low level
Specifications
Business
Goals
Automate Examples using
tools like
Cucumber
JBEHAVE
Specflow
You can use
Conventional UNIT
testing or dedicated
BDD for this
These specs are
generated using a
common language
Fannie Mae Confidential and Proprietary 5
Build The
Thing
Right
Build The
right
thing
BDD in the context of Test Automation
SCENARIO
Books can be added to the shopping cart
Given my shopping cart is empty
When I add the book “Harry Potter” to my
shopping cart
Then my shopping cart should contain 1
copy
of “Harry Potter”
SCENARIO
Books can be removed from the shopping cart
SCENARIO
Shopping cart is initially empty
SCENARIO
The same book can be added multiple times to the
shopping cart
Manage books in shopping
cart
As a shop visitor…
I want to collect books in my
shopping cart…
So that I can purchase
multiple books at once…
Feature
Fannie Mae Confidential and Proprietary 6
Evolution of UI Automation
2004 2006 Since 2008 Since 2008
Protractor , Selenide,
ng webdriver,
Fluent Selenium
Protractor, Selenide
Simon Stewart at
ThoughtWorks
developed Selenium
WebDriver
Selenium WebDriver
Jason Huggins -
ThoughtWorks started
Selenium RC and IDE
Selenium RC
Many add on's have
been developed on top
of Selenium
WebDriver IO
1980’s
Record and Play
Automation tools
Fannie Mae Confidential and Proprietary 7
Basic needs of UI automation
Designed
for Test
automation
Executes
on multiple
operating
systems
Multi
browser
execution
Supports
Multiple
test
framework
s
CICD and
build tools
integration
Remote
execution
support
Fannie Mae Confidential and Proprietary 8
Fannie Mae Confidential and Proprietary 9
Selenide Test
Fannie Mae Confidential and Proprietary 10
Customization
Fannie Mae Confidential and Proprietary 11
BDD With Selenide
Fannie Mae Confidential and Proprietary 12
Writing
Test Code
that
matters
Selenide Additional Benefits
13
Solves the problem of
time out issues
No more Stale
Exceptions
Inbuilt evidence
capturing mechanism
Inbuilt validation
mechanism
Additional UI locators
Reduces the need of
adding lot of third party
libraries
Concise API
Reduces the need of
writing Boiler plate
code
Fannie Mae Confidential and Proprietary
open("https://saucecon.co
m/");
$(byText("AGENDA")).clic
k();
$(byText("ABOUT")).shou
ldBe(Condition.visible)
Additional Selectors
Fannie Mae Confidential and Proprietary 14
import static com.codeborne.selenide.Selectors.*;
Parent / Child Selectors
Fannie Mae Confidential and Proprietary 15
Find data in a table row by
content
jQuery Sizzle Selectors
$$(":input").shouldBe(CollectionCondition.sizeGreaterThan(3));
$("input:first").shouldBe(Condition.readonly);
$("input:nth(1)").shouldNotHave(Condition.enabled);
Fannie Mae Confidential and Proprietary 16
Angular libraries
Fannie Mae Confidential and Proprietary 17
Angular Support
Fannie Mae Confidential and Proprietary 18
$(ByAngular.buttonText("Customer Login")).click();
$(ByAngular.cssContainingText("#CSSSelector","ExpectedText")).
getSelectedOptions();
$(ByAngular.exactRepeater("ngrepeater")).data("RepeaterData").
contentEquals("Expected Data");
$(ByAngular.model(("ng-model")).cssSelector("CSS Selector").linkText("Select
Angular")).shouldNotBe(Condition.empty);
Custom Matchers
Fannie Mae Confidential and Proprietary 19
Radio Buttons
Traditional Style:
for(webElement radio: driver.findElement (By.name(“Admin Role”)))
{
if(“Admin Role”.equals(radio.getAttribute(“value”)))
{
radio.click();
}
}
throw new NoSuchElementException(“Radio field has no value);
Selenide Way:
selectRadio(By.name(“role”),”Admin Role”);
Fannie Mae Confidential and Proprietary 20
List Boxes
Traditional Style
List<WebElement> fields = previewPricePage.getAllTableFields();
for(int i = 0; i < fields.size(); i++)
{
if(fields.get(i).getText().matches("[0-9.]+")) break;
else{ if(fields.get(i).getText().equals(col1))
Assert.assertEquals(col2,fields.get(i+1).getText());
}
}
Selenide List Box:
$(“By.id”).shouldHave(“Expected Text”);
Fannie Mae Confidential and Proprietary 21
Alert Boxes
Traditional Style:
try {
driver.switchTo().alert().accept();
driver.switchTo().defaultContent();
} catch (Exception e) {
e.printStackTrace();
}
Selenide:
confirm(“Are you sure to delete your profile”);
dismiss(“Text on the dismiss box”);
Fannie Mae Confidential and Proprietary 22
More Functions
Fannie Mae Confidential and Proprietary 23
Function Function
$(“div”).scrollTo(); $(“div”).innerText();
$(“div”).innerHtml(); $(“div”).exists();
$(“select”).isImage(); $(“select”).getSelectedText();
$(“select”).getSelectedValue(); $(“div”).doubleClick();
$(“div”).contextClick(); $(“div”).hover();
$(“div”).dragAndDrop(); Zoom(2.5);
Selenide Collections
$$ returns collection of elements
$$(“.error”).shouldHave(size(3));
$$(":input").shouldBe(CollectionCondition.sizeGreaterThan(3));
$$(“#employees tbody tr”).shouldNotHave(texts (“Employee” , “ID : 222” “Admin_Role”));
$$(“#employees tbody tr”).filter(visible).shouldHave(size(4));
Fannie Mae Confidential and Proprietary 24
Selenide Collections
$$(By.xpath("XPATH")).shouldHaveSize(1); (Verifies size)
$$(By.xpath("")).shouldHave(CollectionCondition.texts("Expected
Text"));
$$(".element").shouldHave(sizeLessThan(13));
$$(".element").shouldHave(sizeGreaterThan(11));
$$(".element").shouldHave(sizeGreaterThanOrEqual(12));
$$(".element").shouldHave(sizeNotEqual(42));
Fannie Mae Confidential and Proprietary 25
File Downloads
Fannie Mae Confidential and Proprietary 26
Compare Files
Fannie Mae Confidential and Proprietary 27
File Operations
Fannie Mae Confidential and Proprietary 28
$(".btn#cv").download().compareTo(ExpectedFile);
ü loanDetails_PDF.getParentFile();
ü loanDetails_PDF.isDirectory();
ü loanDetails_PDF.length();
ü loanDetails_PDF.getPath();
ü loanDetails_PDF.canRead();
ü loanDetails_PDF.canWrite();
ü loanDetails_PDF.canExecute();
ü File.createTempFile("prefix", "suffix");
File Operations
Fannie Mae Confidential and Proprietary 29
sellerDetails = $(".btn#cv").uploadFile(uploadFile);
$(".btn#cv").uploadFile(new File("CV1.doc"),
new File("CV2.doc"),
new File("CV3.doc"));
$(".btn#cv").uploadFromClasspath(fileName);
Page Object Design Pattern
Actual Test Class
Fannie Mae Confidential and Proprietary 30
Classic Page Objects
Fannie Mae Confidential and Proprietary 31
Fannie Mae Confidential and Proprietary 32
Fannie Mae Confidential and Proprietary 33
Return On Investment
End to End Test
Integration Test
Unit Tests
Manual Checking
Exploratory
UI Based
Workflow Tests
API/ Service Layer
Business Rules/
Functional Tests
Unit Tests/ Component Tests
80-90%
5-15%
0-5%
5-10%
20-30%
80-85%
Traditional
TDD and BDD
Fannie Mae Confidential and Proprietary 34
Return On Investment
40%
Reduction in
coding effort
Concise API
With Selenide’s Concise API your coding effort is
reduced by 40% or more depending on the application
under test, thereby improves maintainability.
30%
Increase in script
reliability
As Selenide is built for the purpose of test automation, it
supports lot of additional application specific locators
which increases reliability of your executions.
Fannie Mae Confidential and Proprietary 35
Resources
Fannie Mae Confidential and Proprietary 36
Selenide Articles:
Selenide CheatSheet: https://gist.github.com/mkpythonanywhereblog/947633ba1bf0bc239639
Selenide Official site: https://selenide.org/quick-start.html
Selenide JavaDoc: https://selenide.org/javadoc/current/
https://zeroturnaround.com/rebellabs/if-you-use-selenium-for-browser-based-ui-acceptance-testing-you-might-like-
selenide/
Selenide Code reference:
Selenide Git Repo: https://github.com/selenide/selenide
Selenide Change Log: https://github.com/selenide/selenide/blob/master/CHANGELOG.md
Selenide Example projects: https://github.com/selenide-examples
Fannie Mae Confidential and Proprietary
BDD With Selenide is all about
Writing Software that not only works but matters.
Hima Bindu Peteti
linkedin.com/in/hima-bindu-peteti-378152a4

More Related Content

Similar to BDD With Selenide by Hima Bindu Peteti

Working With The Symfony Admin Generator
Working With The Symfony Admin GeneratorWorking With The Symfony Admin Generator
Working With The Symfony Admin Generator
John Cleveley
 
Codegnitorppt
CodegnitorpptCodegnitorppt
Codegnitorppt
sreedath c g
 
Web UI Tests: Introduce UI tests using Selenium
Web UI Tests: Introduce UI tests using Selenium Web UI Tests: Introduce UI tests using Selenium
Web UI Tests: Introduce UI tests using Selenium
Peyman Fakharian
 
Apex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsApex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong Foundations
Salesforce Developers
 
The SharePoint & jQuery Guide - Updated 1/14/14
The SharePoint & jQuery Guide - Updated 1/14/14The SharePoint & jQuery Guide - Updated 1/14/14
The SharePoint & jQuery Guide - Updated 1/14/14
Mark Rackley
 
20150728 100분만에 배우는 windows 10 앱 개발
20150728 100분만에 배우는 windows 10 앱 개발20150728 100분만에 배우는 windows 10 앱 개발
20150728 100분만에 배우는 windows 10 앱 개발
영욱 김
 
Application development using Zend Framework
Application development using Zend FrameworkApplication development using Zend Framework
Application development using Zend Framework
Mahmud Ahsan
 
php
phpphp
ASPNET for PHP Developers
ASPNET for PHP DevelopersASPNET for PHP Developers
ASPNET for PHP Developers
Wes Yanaga
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
Francois Zaninotto
 
Better User Experience with .NET
Better User Experience with .NETBetter User Experience with .NET
Better User Experience with .NET
Peter Gfader
 
Silverlight 5 whats new overview
Silverlight 5 whats new overviewSilverlight 5 whats new overview
Silverlight 5 whats new overview
mdc11
 
visual basic 2005 programmer certification
visual basic 2005 programmer certificationvisual basic 2005 programmer certification
visual basic 2005 programmer certification
Vskills
 
Developing Next-Gen Enterprise Web Application
Developing Next-Gen Enterprise Web ApplicationDeveloping Next-Gen Enterprise Web Application
Developing Next-Gen Enterprise Web Application
Mark Gu
 
Net course content
Net course contentNet course content
Net course content
mindq
 
Benefit of CodeIgniter php framework
Benefit of CodeIgniter php frameworkBenefit of CodeIgniter php framework
Benefit of CodeIgniter php frameworkBo-Yi Wu
 
SharePoint for the .NET Developer
SharePoint for the .NET DeveloperSharePoint for the .NET Developer
SharePoint for the .NET Developer
John Calvert
 
Getting Started with Iron Speed Designer
Getting Started with Iron Speed DesignerGetting Started with Iron Speed Designer
Getting Started with Iron Speed Designer
Iron Speed
 
Alm Specialist Toolkit Team System 2008 Deep Dive
Alm Specialist Toolkit   Team System 2008 Deep DiveAlm Specialist Toolkit   Team System 2008 Deep Dive
Alm Specialist Toolkit Team System 2008 Deep DiveChristian Thilmany
 
Code Generation in Magento 2
Code Generation in Magento 2Code Generation in Magento 2
Code Generation in Magento 2
Sergii Shymko
 

Similar to BDD With Selenide by Hima Bindu Peteti (20)

Working With The Symfony Admin Generator
Working With The Symfony Admin GeneratorWorking With The Symfony Admin Generator
Working With The Symfony Admin Generator
 
Codegnitorppt
CodegnitorpptCodegnitorppt
Codegnitorppt
 
Web UI Tests: Introduce UI tests using Selenium
Web UI Tests: Introduce UI tests using Selenium Web UI Tests: Introduce UI tests using Selenium
Web UI Tests: Introduce UI tests using Selenium
 
Apex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsApex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong Foundations
 
The SharePoint & jQuery Guide - Updated 1/14/14
The SharePoint & jQuery Guide - Updated 1/14/14The SharePoint & jQuery Guide - Updated 1/14/14
The SharePoint & jQuery Guide - Updated 1/14/14
 
20150728 100분만에 배우는 windows 10 앱 개발
20150728 100분만에 배우는 windows 10 앱 개발20150728 100분만에 배우는 windows 10 앱 개발
20150728 100분만에 배우는 windows 10 앱 개발
 
Application development using Zend Framework
Application development using Zend FrameworkApplication development using Zend Framework
Application development using Zend Framework
 
php
phpphp
php
 
ASPNET for PHP Developers
ASPNET for PHP DevelopersASPNET for PHP Developers
ASPNET for PHP Developers
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
Better User Experience with .NET
Better User Experience with .NETBetter User Experience with .NET
Better User Experience with .NET
 
Silverlight 5 whats new overview
Silverlight 5 whats new overviewSilverlight 5 whats new overview
Silverlight 5 whats new overview
 
visual basic 2005 programmer certification
visual basic 2005 programmer certificationvisual basic 2005 programmer certification
visual basic 2005 programmer certification
 
Developing Next-Gen Enterprise Web Application
Developing Next-Gen Enterprise Web ApplicationDeveloping Next-Gen Enterprise Web Application
Developing Next-Gen Enterprise Web Application
 
Net course content
Net course contentNet course content
Net course content
 
Benefit of CodeIgniter php framework
Benefit of CodeIgniter php frameworkBenefit of CodeIgniter php framework
Benefit of CodeIgniter php framework
 
SharePoint for the .NET Developer
SharePoint for the .NET DeveloperSharePoint for the .NET Developer
SharePoint for the .NET Developer
 
Getting Started with Iron Speed Designer
Getting Started with Iron Speed DesignerGetting Started with Iron Speed Designer
Getting Started with Iron Speed Designer
 
Alm Specialist Toolkit Team System 2008 Deep Dive
Alm Specialist Toolkit   Team System 2008 Deep DiveAlm Specialist Toolkit   Team System 2008 Deep Dive
Alm Specialist Toolkit Team System 2008 Deep Dive
 
Code Generation in Magento 2
Code Generation in Magento 2Code Generation in Magento 2
Code Generation in Magento 2
 

More from Sauce Labs

Simplify Salesforce Testing with AI-Driven Codeless Tools
Simplify Salesforce Testing with AI-Driven Codeless ToolsSimplify Salesforce Testing with AI-Driven Codeless Tools
Simplify Salesforce Testing with AI-Driven Codeless Tools
Sauce Labs
 
Testing on Mobile Devices with Location Services
Testing on Mobile Devices with Location ServicesTesting on Mobile Devices with Location Services
Testing on Mobile Devices with Location Services
Sauce Labs
 
Your Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at ScaleYour Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at Scale
Sauce Labs
 
Automating Hybrid Applications with Appium
Automating Hybrid Applications with AppiumAutomating Hybrid Applications with Appium
Automating Hybrid Applications with Appium
Sauce Labs
 
Quality at Speed: More API Testing, Less UI Testing
Quality at Speed: More API Testing, Less UI TestingQuality at Speed: More API Testing, Less UI Testing
Quality at Speed: More API Testing, Less UI Testing
Sauce Labs
 
Creating Digital Confidence with Test Automation
Creating Digital Confidence with Test AutomationCreating Digital Confidence with Test Automation
Creating Digital Confidence with Test Automation
Sauce Labs
 
Just Enough (Automated) Testing
Just Enough (Automated) TestingJust Enough (Automated) Testing
Just Enough (Automated) Testing
Sauce Labs
 
Using Axe to Add Accessibility Checks to Your Existing Selenium Tests
Using Axe to Add Accessibility Checks to Your Existing Selenium TestsUsing Axe to Add Accessibility Checks to Your Existing Selenium Tests
Using Axe to Add Accessibility Checks to Your Existing Selenium Tests
Sauce Labs
 
How Open Source Helps to Bring Back Product Obsession
How Open Source Helps to Bring Back Product ObsessionHow Open Source Helps to Bring Back Product Obsession
How Open Source Helps to Bring Back Product Obsession
Sauce Labs
 
Webinar: A Sneak Peek at Selenium 4 with Simon Stewart
Webinar: A Sneak Peek at Selenium 4 with Simon StewartWebinar: A Sneak Peek at Selenium 4 with Simon Stewart
Webinar: A Sneak Peek at Selenium 4 with Simon Stewart
Sauce Labs
 
[Deu] Test Automatisierung Mit Web Driver.io
[Deu] Test Automatisierung Mit Web Driver.io[Deu] Test Automatisierung Mit Web Driver.io
[Deu] Test Automatisierung Mit Web Driver.io
Sauce Labs
 
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
Sauce Labs
 
Accelerating Your Digital Agenda with Continuous Testing ft. Forrester
Accelerating Your Digital Agenda with Continuous Testing ft. ForresterAccelerating Your Digital Agenda with Continuous Testing ft. Forrester
Accelerating Your Digital Agenda with Continuous Testing ft. Forrester
Sauce Labs
 
How to Measure Success in Continuous Testing
How to Measure Success in Continuous TestingHow to Measure Success in Continuous Testing
How to Measure Success in Continuous Testing
Sauce Labs
 
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
Sauce Labs
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation
Sauce Labs
 
Sauce Labs Webinar: Rising Importance of Software Testing
Sauce Labs Webinar: Rising Importance of Software TestingSauce Labs Webinar: Rising Importance of Software Testing
Sauce Labs Webinar: Rising Importance of Software Testing
Sauce Labs
 
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Sauce Labs
 
Continuous Delivery for "Mature" Codebases by Melisa Benua
Continuous Delivery for "Mature" Codebases by Melisa BenuaContinuous Delivery for "Mature" Codebases by Melisa Benua
Continuous Delivery for "Mature" Codebases by Melisa Benua
Sauce Labs
 
Building Automation Engineers From Scratch by Jenny Bramble
Building Automation Engineers From Scratch by Jenny BrambleBuilding Automation Engineers From Scratch by Jenny Bramble
Building Automation Engineers From Scratch by Jenny Bramble
Sauce Labs
 

More from Sauce Labs (20)

Simplify Salesforce Testing with AI-Driven Codeless Tools
Simplify Salesforce Testing with AI-Driven Codeless ToolsSimplify Salesforce Testing with AI-Driven Codeless Tools
Simplify Salesforce Testing with AI-Driven Codeless Tools
 
Testing on Mobile Devices with Location Services
Testing on Mobile Devices with Location ServicesTesting on Mobile Devices with Location Services
Testing on Mobile Devices with Location Services
 
Your Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at ScaleYour Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at Scale
 
Automating Hybrid Applications with Appium
Automating Hybrid Applications with AppiumAutomating Hybrid Applications with Appium
Automating Hybrid Applications with Appium
 
Quality at Speed: More API Testing, Less UI Testing
Quality at Speed: More API Testing, Less UI TestingQuality at Speed: More API Testing, Less UI Testing
Quality at Speed: More API Testing, Less UI Testing
 
Creating Digital Confidence with Test Automation
Creating Digital Confidence with Test AutomationCreating Digital Confidence with Test Automation
Creating Digital Confidence with Test Automation
 
Just Enough (Automated) Testing
Just Enough (Automated) TestingJust Enough (Automated) Testing
Just Enough (Automated) Testing
 
Using Axe to Add Accessibility Checks to Your Existing Selenium Tests
Using Axe to Add Accessibility Checks to Your Existing Selenium TestsUsing Axe to Add Accessibility Checks to Your Existing Selenium Tests
Using Axe to Add Accessibility Checks to Your Existing Selenium Tests
 
How Open Source Helps to Bring Back Product Obsession
How Open Source Helps to Bring Back Product ObsessionHow Open Source Helps to Bring Back Product Obsession
How Open Source Helps to Bring Back Product Obsession
 
Webinar: A Sneak Peek at Selenium 4 with Simon Stewart
Webinar: A Sneak Peek at Selenium 4 with Simon StewartWebinar: A Sneak Peek at Selenium 4 with Simon Stewart
Webinar: A Sneak Peek at Selenium 4 with Simon Stewart
 
[Deu] Test Automatisierung Mit Web Driver.io
[Deu] Test Automatisierung Mit Web Driver.io[Deu] Test Automatisierung Mit Web Driver.io
[Deu] Test Automatisierung Mit Web Driver.io
 
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
 
Accelerating Your Digital Agenda with Continuous Testing ft. Forrester
Accelerating Your Digital Agenda with Continuous Testing ft. ForresterAccelerating Your Digital Agenda with Continuous Testing ft. Forrester
Accelerating Your Digital Agenda with Continuous Testing ft. Forrester
 
How to Measure Success in Continuous Testing
How to Measure Success in Continuous TestingHow to Measure Success in Continuous Testing
How to Measure Success in Continuous Testing
 
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation
 
Sauce Labs Webinar: Rising Importance of Software Testing
Sauce Labs Webinar: Rising Importance of Software TestingSauce Labs Webinar: Rising Importance of Software Testing
Sauce Labs Webinar: Rising Importance of Software Testing
 
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
 
Continuous Delivery for "Mature" Codebases by Melisa Benua
Continuous Delivery for "Mature" Codebases by Melisa BenuaContinuous Delivery for "Mature" Codebases by Melisa Benua
Continuous Delivery for "Mature" Codebases by Melisa Benua
 
Building Automation Engineers From Scratch by Jenny Bramble
Building Automation Engineers From Scratch by Jenny BrambleBuilding Automation Engineers From Scratch by Jenny Bramble
Building Automation Engineers From Scratch by Jenny Bramble
 

Recently uploaded

Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
MayankTawar1
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
varshanayak241
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
ayushiqss
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 

Recently uploaded (20)

Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 

BDD With Selenide by Hima Bindu Peteti

  • 1. Fannie Mae Confidential and Proprietary BDD With Selenide Hima Bindu Peteti Saucecon 2019
  • 2. 0 2 HIMA BINDU PETETI Senior Software Engineer Experienced in designing and developing large scale web applications and designing complex test automation frameworks using Java / JEE technologies. Passionate about open-source automation frameworks that provide application modeling, unit, integration, functional, and visual testing. Contact me at linkedin.com/in/hima-bindu-peteti-378152a4
  • 3. Agenda BDD in the context of test automation 01 Selenium Vs Selenide02 Selenide deep dive 03 04 05 06 Additional Selenide benefits Compare coding in Selenium and Selenide Design Patterns Fannie Mae Confidential and Proprietary 3
  • 4. Bridging the gap between Business and Technology Fannie Mae Confidential and Proprietary 4 Business Technology
  • 5. BDD in the context of Test Automation Features Examples Executable Specification’s Low level Specifications Business Goals Automate Examples using tools like Cucumber JBEHAVE Specflow You can use Conventional UNIT testing or dedicated BDD for this These specs are generated using a common language Fannie Mae Confidential and Proprietary 5 Build The Thing Right Build The right thing
  • 6. BDD in the context of Test Automation SCENARIO Books can be added to the shopping cart Given my shopping cart is empty When I add the book “Harry Potter” to my shopping cart Then my shopping cart should contain 1 copy of “Harry Potter” SCENARIO Books can be removed from the shopping cart SCENARIO Shopping cart is initially empty SCENARIO The same book can be added multiple times to the shopping cart Manage books in shopping cart As a shop visitor… I want to collect books in my shopping cart… So that I can purchase multiple books at once… Feature Fannie Mae Confidential and Proprietary 6
  • 7. Evolution of UI Automation 2004 2006 Since 2008 Since 2008 Protractor , Selenide, ng webdriver, Fluent Selenium Protractor, Selenide Simon Stewart at ThoughtWorks developed Selenium WebDriver Selenium WebDriver Jason Huggins - ThoughtWorks started Selenium RC and IDE Selenium RC Many add on's have been developed on top of Selenium WebDriver IO 1980’s Record and Play Automation tools Fannie Mae Confidential and Proprietary 7
  • 8. Basic needs of UI automation Designed for Test automation Executes on multiple operating systems Multi browser execution Supports Multiple test framework s CICD and build tools integration Remote execution support Fannie Mae Confidential and Proprietary 8
  • 9. Fannie Mae Confidential and Proprietary 9
  • 10. Selenide Test Fannie Mae Confidential and Proprietary 10
  • 12. BDD With Selenide Fannie Mae Confidential and Proprietary 12 Writing Test Code that matters
  • 13. Selenide Additional Benefits 13 Solves the problem of time out issues No more Stale Exceptions Inbuilt evidence capturing mechanism Inbuilt validation mechanism Additional UI locators Reduces the need of adding lot of third party libraries Concise API Reduces the need of writing Boiler plate code Fannie Mae Confidential and Proprietary open("https://saucecon.co m/"); $(byText("AGENDA")).clic k(); $(byText("ABOUT")).shou ldBe(Condition.visible)
  • 14. Additional Selectors Fannie Mae Confidential and Proprietary 14 import static com.codeborne.selenide.Selectors.*;
  • 15. Parent / Child Selectors Fannie Mae Confidential and Proprietary 15 Find data in a table row by content
  • 17. Angular libraries Fannie Mae Confidential and Proprietary 17
  • 18. Angular Support Fannie Mae Confidential and Proprietary 18 $(ByAngular.buttonText("Customer Login")).click(); $(ByAngular.cssContainingText("#CSSSelector","ExpectedText")). getSelectedOptions(); $(ByAngular.exactRepeater("ngrepeater")).data("RepeaterData"). contentEquals("Expected Data"); $(ByAngular.model(("ng-model")).cssSelector("CSS Selector").linkText("Select Angular")).shouldNotBe(Condition.empty);
  • 19. Custom Matchers Fannie Mae Confidential and Proprietary 19
  • 20. Radio Buttons Traditional Style: for(webElement radio: driver.findElement (By.name(“Admin Role”))) { if(“Admin Role”.equals(radio.getAttribute(“value”))) { radio.click(); } } throw new NoSuchElementException(“Radio field has no value); Selenide Way: selectRadio(By.name(“role”),”Admin Role”); Fannie Mae Confidential and Proprietary 20
  • 21. List Boxes Traditional Style List<WebElement> fields = previewPricePage.getAllTableFields(); for(int i = 0; i < fields.size(); i++) { if(fields.get(i).getText().matches("[0-9.]+")) break; else{ if(fields.get(i).getText().equals(col1)) Assert.assertEquals(col2,fields.get(i+1).getText()); } } Selenide List Box: $(“By.id”).shouldHave(“Expected Text”); Fannie Mae Confidential and Proprietary 21
  • 22. Alert Boxes Traditional Style: try { driver.switchTo().alert().accept(); driver.switchTo().defaultContent(); } catch (Exception e) { e.printStackTrace(); } Selenide: confirm(“Are you sure to delete your profile”); dismiss(“Text on the dismiss box”); Fannie Mae Confidential and Proprietary 22
  • 23. More Functions Fannie Mae Confidential and Proprietary 23 Function Function $(“div”).scrollTo(); $(“div”).innerText(); $(“div”).innerHtml(); $(“div”).exists(); $(“select”).isImage(); $(“select”).getSelectedText(); $(“select”).getSelectedValue(); $(“div”).doubleClick(); $(“div”).contextClick(); $(“div”).hover(); $(“div”).dragAndDrop(); Zoom(2.5);
  • 24. Selenide Collections $$ returns collection of elements $$(“.error”).shouldHave(size(3)); $$(":input").shouldBe(CollectionCondition.sizeGreaterThan(3)); $$(“#employees tbody tr”).shouldNotHave(texts (“Employee” , “ID : 222” “Admin_Role”)); $$(“#employees tbody tr”).filter(visible).shouldHave(size(4)); Fannie Mae Confidential and Proprietary 24
  • 25. Selenide Collections $$(By.xpath("XPATH")).shouldHaveSize(1); (Verifies size) $$(By.xpath("")).shouldHave(CollectionCondition.texts("Expected Text")); $$(".element").shouldHave(sizeLessThan(13)); $$(".element").shouldHave(sizeGreaterThan(11)); $$(".element").shouldHave(sizeGreaterThanOrEqual(12)); $$(".element").shouldHave(sizeNotEqual(42)); Fannie Mae Confidential and Proprietary 25
  • 26. File Downloads Fannie Mae Confidential and Proprietary 26
  • 27. Compare Files Fannie Mae Confidential and Proprietary 27
  • 28. File Operations Fannie Mae Confidential and Proprietary 28 $(".btn#cv").download().compareTo(ExpectedFile); ü loanDetails_PDF.getParentFile(); ü loanDetails_PDF.isDirectory(); ü loanDetails_PDF.length(); ü loanDetails_PDF.getPath(); ü loanDetails_PDF.canRead(); ü loanDetails_PDF.canWrite(); ü loanDetails_PDF.canExecute(); ü File.createTempFile("prefix", "suffix");
  • 29. File Operations Fannie Mae Confidential and Proprietary 29 sellerDetails = $(".btn#cv").uploadFile(uploadFile); $(".btn#cv").uploadFile(new File("CV1.doc"), new File("CV2.doc"), new File("CV3.doc")); $(".btn#cv").uploadFromClasspath(fileName);
  • 30. Page Object Design Pattern Actual Test Class Fannie Mae Confidential and Proprietary 30
  • 31. Classic Page Objects Fannie Mae Confidential and Proprietary 31
  • 32. Fannie Mae Confidential and Proprietary 32
  • 33. Fannie Mae Confidential and Proprietary 33
  • 34. Return On Investment End to End Test Integration Test Unit Tests Manual Checking Exploratory UI Based Workflow Tests API/ Service Layer Business Rules/ Functional Tests Unit Tests/ Component Tests 80-90% 5-15% 0-5% 5-10% 20-30% 80-85% Traditional TDD and BDD Fannie Mae Confidential and Proprietary 34
  • 35. Return On Investment 40% Reduction in coding effort Concise API With Selenide’s Concise API your coding effort is reduced by 40% or more depending on the application under test, thereby improves maintainability. 30% Increase in script reliability As Selenide is built for the purpose of test automation, it supports lot of additional application specific locators which increases reliability of your executions. Fannie Mae Confidential and Proprietary 35
  • 36. Resources Fannie Mae Confidential and Proprietary 36 Selenide Articles: Selenide CheatSheet: https://gist.github.com/mkpythonanywhereblog/947633ba1bf0bc239639 Selenide Official site: https://selenide.org/quick-start.html Selenide JavaDoc: https://selenide.org/javadoc/current/ https://zeroturnaround.com/rebellabs/if-you-use-selenium-for-browser-based-ui-acceptance-testing-you-might-like- selenide/ Selenide Code reference: Selenide Git Repo: https://github.com/selenide/selenide Selenide Change Log: https://github.com/selenide/selenide/blob/master/CHANGELOG.md Selenide Example projects: https://github.com/selenide-examples
  • 37. Fannie Mae Confidential and Proprietary BDD With Selenide is all about Writing Software that not only works but matters. Hima Bindu Peteti linkedin.com/in/hima-bindu-peteti-378152a4