SlideShare a Scribd company logo
Test Client & User Interface
using Selenium
Peyman Fakharian
Hamed Salimian
Software Testing
Computer Department, Sharif University of Technology
2017-12
1
Web testing
 Automated testing is an extremely useful bug-killing tool
for the modern Web development
 Testing a Web application is a complex task
 several layers of logic
 test-execution framework
 Web testing main parts
 Database
 URL- Context
 HTTP requests
 Client/User Interface
2
Client Testing
 Simulate GET and POST requests on a URL and observe the
response
 See the chain of redirects (if any) and check the URL and
status code at each step.
 Test that a given request is rendered with a context that
contains certain values.
 HTTP-based Client tests vs. in-browser frameworks
3
HTTP-based Testing
 Get/POST requests
 API
 Login/Register
 Search
 Status codes
4
HTTP-based Testing (cont.)
 Let’s see in action!
5
Selenium
 So what is Selenium?
 Selenium automates browsers
 automating web applications for testing purposes
 automating Boring web-based administration tasks
 Selenium Web Driver
 create robust, browser-based regression automation suites and tests
 Previously known as Selenium RC (Remote Control)
 Selenium IDE
 create quick bug reproduction scripts
 Firefox add-on
6
Selenium available
languages
Selenium WebDriver
 Driving a browser natively as a user would either locally or
on a remote machine
 An API driven browser
 Chrome
 Firefox,
 Safari
 IE
 PhantomJS Driver
 Remote web Driver
7
Selenium (cont.)
 So why we need selenium?
 Simulate user interactions
 Test in different browsers
 AJAX applications
 DO all things a user could do in a browser! Not just http
requests, any thing!
 Selenium is humanized!
 Not only your code
 Also your interactions!
 Integration with different web frameworks
8
Getting started!
 Walk through the selenium docs example
9
Testing forms
Let’s try
this
example
step by
step!
10
Testing form fields
a simple regex to detect
phone numbers with
exact 11 digits
11
Navigation Utilities
 Selenium provides different navigation utilities
 Click links
 Submit forms
 Drag and drop
 Moving between windows
 Browser history
 Also provides cookies
 So you can use session
 Login, authentication, authorization, … made easy now!
Drag & drop from selenium documentation
12
Locating Elements
 Let’s see through an example
13
Waits capability
 most of the web apps are using AJAX
 if an element is not yet present in the DOM, a locate
function will raise an ElementNotVisibleException exception
 Waiting provides some slack between actions performed
 Implicit (makes WebDriver poll the DOM for a certain amount
of time)
 Explicit (certain condition)
 Let’s see in action!
14
Test design
 Types of tests
 Static content
 Links
 Function tests
 Ajax tests
 Locating strategy
 Dynamic elements
 User interface mapping
 makes script maintenance more efficient
 more human-readable names
 Database Validation
15
Data driven testing
 using the same test (or tests) multiple times with varying
data
 data sets are often from external files i.e. .csv
 validate an application against many varying inputs
 Let’s write some codes!
16
Page object design pattern
 A page object represents an area in the web application user
interface that your test is interacting.
 Benefits of using page object pattern:
 Creating reusable code that can be shared across multiple test
cases
 improve readability
 Reducing the amount of duplicated code
 If the user interface changes, the fix needs changes in only one
place
 creating an object for each web page
 create robust, browser-based regression automation suites and
tests
 By following this technique a layer of separation between the
test code and technical implementation is created
17
Page object design pattern
(cont.)
Image source: blazemeter tech. blog
18
Page object design pattern
(cont.)
 Consist of two/three/four main parts:
 Locators
 Elements
 Pages
 Tests
 Page object design pattern has been evolved in screenplay
pattern.
 Let’s execute some codes!
19
Selenium grid
 Selenium-Grid allows you run your tests on different machines
against different browsers in parallel.
 support distributed test execution
 When you should use selenium grid?
 To reduce the time it takes for the test suite to complete
 To run your tests against multiple browsers, multiple versions of
browser, and browsers running on different operating systems.
 Steps:
 Install selenium server/grid (jar file)
 Run selenium server and create a hub
 Create multiple nodes as you want
20
Notable features
 Use proxy for browser startup
 Action chains
 Key up, hover, key down, enter, move, etc.
 Remote web-driver
 Desired Capabilities
 Color support
Example of desired capacities
21
Notable features (cont.)
 Save/download/upload files
 Custom Firefox profile
 Take screenshot
 All user navigations
 Selenium Web Driver
Custom Firefox profile
22
Other Selenium applications
 Not only for test automation
 Crawl/scrape ajax based pages
 Monitoring/Metric collections
Examples of Yektanet ads
23
Selenium project has a
conference!
 The Official 2017 European Selenium Conference
 Berlin, Germany | 9–10 October
 You can watch the talks in selenium YouTube channel
 https://www.youtube.com/user/seleniumconf/videos
24
Conclusion
 Selenium automates browsers
 automating web applications for testing purposes
 You can do anything a real user does on your website
 Simulate various type/version of the browsers
 Great features, human readable
 Introduce/develop some test design patterns
25
Any Question?26
Ad

Recommended

API Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid Rahimian
API Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid Rahimian
Vahid Rahimian
 
Dev ops, from theory to practice, by vahid rahimian
Dev ops, from theory to practice, by vahid rahimian
Vahid Rahimian
 
PHP Symfony MicroServices Migration @MeeticTech
PHP Symfony MicroServices Migration @MeeticTech
meeticTech
 
SP2010 Developer Tools
SP2010 Developer Tools
Mohamed Yehia Abdul Kader
 
Whats New In 2010 (Msdn & Visual Studio)
Whats New In 2010 (Msdn & Visual Studio)
Steve Lange
 
Testing soa, web services and application development framework applications
Testing soa, web services and application development framework applications
InSync Conference
 
Best Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point Solutions
Alexander Meijers
 
Kasten securing access to your kubernetes applications
Kasten securing access to your kubernetes applications
LibbySchulze
 
Application Testing Suite
Application Testing Suite
oracleonthebrain
 
Vsts 2
Vsts 2
Mohamed Samy
 
Frequently Used Off Host Developer Toolsl
Frequently Used Off Host Developer Toolsl
Sharan S
 
Team Foundation Server Version Control
Team Foundation Server Version Control
Steve Lange
 
Team Foundation Server - Source Control
Team Foundation Server - Source Control
Dhirendra Singh
 
Performance Testing REST APIs
Performance Testing REST APIs
Jason Weden
 
Vsts Msdn Presentation2003
Vsts Msdn Presentation2003
John Sanderson
 
Xamarin.Forms Bootcamp
Xamarin.Forms Bootcamp
Mike Melusky
 
Oracle Application Testing Suite. Competitive Edge
Oracle Application Testing Suite. Competitive Edge
Maija Laksa
 
REX Meetic, Comment la qualité reflète-t-elle nos organisations ?
REX Meetic, Comment la qualité reflète-t-elle nos organisations ?
meeticTech
 
Develop business apps cross-platform development using visual studio with x...
Develop business apps cross-platform development using visual studio with x...
Alexander Meijers
 
What's new in ALM using Visual Studio 2013 and TFS 2013
What's new in ALM using Visual Studio 2013 and TFS 2013
Microsoft Visual Studio
 
Selenium WebDriver
Selenium WebDriver
Sachin-QA
 
VishalSinha_Resume_Ora
VishalSinha_Resume_Ora
Vishal Sinha
 
Oracle application testing suite online training
Oracle application testing suite online training
Glory IT Technologies Pvt. Ltd.
 
Symantec I3 - Inquire & Cluster
Symantec I3 - Inquire & Cluster
sebastian.guerrero
 
Introduction To CodeIgniter
Introduction To CodeIgniter
schwebbie
 
Crafting ColdFusion Applications like an Architect
Crafting ColdFusion Applications like an Architect
ColdFusionConference
 
CodeIgniter - PHP MVC Framework by silicongulf.com
CodeIgniter - PHP MVC Framework by silicongulf.com
Christopher Cubos
 
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
Richard Robinson
 
Selenium
Selenium
Sun Technlogies
 
#2 integration + ui tests
#2 integration + ui tests
eleksdev
 

More Related Content

What's hot (20)

Application Testing Suite
Application Testing Suite
oracleonthebrain
 
Vsts 2
Vsts 2
Mohamed Samy
 
Frequently Used Off Host Developer Toolsl
Frequently Used Off Host Developer Toolsl
Sharan S
 
Team Foundation Server Version Control
Team Foundation Server Version Control
Steve Lange
 
Team Foundation Server - Source Control
Team Foundation Server - Source Control
Dhirendra Singh
 
Performance Testing REST APIs
Performance Testing REST APIs
Jason Weden
 
Vsts Msdn Presentation2003
Vsts Msdn Presentation2003
John Sanderson
 
Xamarin.Forms Bootcamp
Xamarin.Forms Bootcamp
Mike Melusky
 
Oracle Application Testing Suite. Competitive Edge
Oracle Application Testing Suite. Competitive Edge
Maija Laksa
 
REX Meetic, Comment la qualité reflète-t-elle nos organisations ?
REX Meetic, Comment la qualité reflète-t-elle nos organisations ?
meeticTech
 
Develop business apps cross-platform development using visual studio with x...
Develop business apps cross-platform development using visual studio with x...
Alexander Meijers
 
What's new in ALM using Visual Studio 2013 and TFS 2013
What's new in ALM using Visual Studio 2013 and TFS 2013
Microsoft Visual Studio
 
Selenium WebDriver
Selenium WebDriver
Sachin-QA
 
VishalSinha_Resume_Ora
VishalSinha_Resume_Ora
Vishal Sinha
 
Oracle application testing suite online training
Oracle application testing suite online training
Glory IT Technologies Pvt. Ltd.
 
Symantec I3 - Inquire & Cluster
Symantec I3 - Inquire & Cluster
sebastian.guerrero
 
Introduction To CodeIgniter
Introduction To CodeIgniter
schwebbie
 
Crafting ColdFusion Applications like an Architect
Crafting ColdFusion Applications like an Architect
ColdFusionConference
 
CodeIgniter - PHP MVC Framework by silicongulf.com
CodeIgniter - PHP MVC Framework by silicongulf.com
Christopher Cubos
 
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
Richard Robinson
 
Frequently Used Off Host Developer Toolsl
Frequently Used Off Host Developer Toolsl
Sharan S
 
Team Foundation Server Version Control
Team Foundation Server Version Control
Steve Lange
 
Team Foundation Server - Source Control
Team Foundation Server - Source Control
Dhirendra Singh
 
Performance Testing REST APIs
Performance Testing REST APIs
Jason Weden
 
Vsts Msdn Presentation2003
Vsts Msdn Presentation2003
John Sanderson
 
Xamarin.Forms Bootcamp
Xamarin.Forms Bootcamp
Mike Melusky
 
Oracle Application Testing Suite. Competitive Edge
Oracle Application Testing Suite. Competitive Edge
Maija Laksa
 
REX Meetic, Comment la qualité reflète-t-elle nos organisations ?
REX Meetic, Comment la qualité reflète-t-elle nos organisations ?
meeticTech
 
Develop business apps cross-platform development using visual studio with x...
Develop business apps cross-platform development using visual studio with x...
Alexander Meijers
 
What's new in ALM using Visual Studio 2013 and TFS 2013
What's new in ALM using Visual Studio 2013 and TFS 2013
Microsoft Visual Studio
 
Selenium WebDriver
Selenium WebDriver
Sachin-QA
 
VishalSinha_Resume_Ora
VishalSinha_Resume_Ora
Vishal Sinha
 
Symantec I3 - Inquire & Cluster
Symantec I3 - Inquire & Cluster
sebastian.guerrero
 
Introduction To CodeIgniter
Introduction To CodeIgniter
schwebbie
 
Crafting ColdFusion Applications like an Architect
Crafting ColdFusion Applications like an Architect
ColdFusionConference
 
CodeIgniter - PHP MVC Framework by silicongulf.com
CodeIgniter - PHP MVC Framework by silicongulf.com
Christopher Cubos
 
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
Richard Robinson
 

Similar to Web UI Tests: Introduce UI tests using Selenium (20)

Selenium
Selenium
Sun Technlogies
 
#2 integration + ui tests
#2 integration + ui tests
eleksdev
 
selenium.ppt
selenium.ppt
rajnexient
 
selenium.ppt
selenium.ppt
AmenSheikh
 
selenium.ppt
selenium.ppt
ssuser7b4894
 
Selenium
Selenium
Purna Chandar
 
Robot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs Integration
Sauce Labs
 
Selenium -Test automation for web applications
Selenium -Test automation for web applications
AnisGhelissi
 
Stepin evening presented
Stepin evening presented
Vijayan Reddy
 
Automated Web Testing With Selenium
Automated Web Testing With Selenium
Jodie Miners
 
Selenium
Selenium
Milind Hali
 
Selenium Basics and Overview topics.pptx
Selenium Basics and Overview topics.pptx
sountharyaravi010
 
Selenium Basics and Overview1233444.pptx
Selenium Basics and Overview1233444.pptx
sountharyaravi010
 
Test automation using selenium
Test automation using selenium
Cynoteck Technology Solutions Private Limited
 
Automated Testing using JavaScript
Automated Testing using JavaScript
Simon Guest
 
Selenium
Selenium
Daksh Sharma
 
By combining Selenium for frontend testing and tools
By combining Selenium for frontend testing and tools
sivanandhumanickam84
 
ASP.NET OVERVIEW
ASP.NET OVERVIEW
Rishi Kothari
 
Selenium ui paradigm - DDD North 2
Selenium ui paradigm - DDD North 2
Nathan Gloyn
 
Session on Selenium 4 : What’s coming our way? by Hitesh Prajapati
Session on Selenium 4 : What’s coming our way? by Hitesh Prajapati
Agile Testing Alliance
 
#2 integration + ui tests
#2 integration + ui tests
eleksdev
 
Robot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs Integration
Sauce Labs
 
Selenium -Test automation for web applications
Selenium -Test automation for web applications
AnisGhelissi
 
Stepin evening presented
Stepin evening presented
Vijayan Reddy
 
Automated Web Testing With Selenium
Automated Web Testing With Selenium
Jodie Miners
 
Selenium Basics and Overview topics.pptx
Selenium Basics and Overview topics.pptx
sountharyaravi010
 
Selenium Basics and Overview1233444.pptx
Selenium Basics and Overview1233444.pptx
sountharyaravi010
 
Automated Testing using JavaScript
Automated Testing using JavaScript
Simon Guest
 
By combining Selenium for frontend testing and tools
By combining Selenium for frontend testing and tools
sivanandhumanickam84
 
Selenium ui paradigm - DDD North 2
Selenium ui paradigm - DDD North 2
Nathan Gloyn
 
Session on Selenium 4 : What’s coming our way? by Hitesh Prajapati
Session on Selenium 4 : What’s coming our way? by Hitesh Prajapati
Agile Testing Alliance
 
Ad

Recently uploaded (20)

Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
Zoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutions
reenashriee
 
Software Testing & it’s types (DevOps)
Software Testing & it’s types (DevOps)
S Pranav (Deepu)
 
Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...
Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...
Intelli grow
 
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
soulamaabdoulaye128
 
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Alluxio, Inc.
 
Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
BradBedford3
 
How to Choose the Right Web Development Agency.pdf
How to Choose the Right Web Development Agency.pdf
Creative Fosters
 
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
Hassan Abid
 
Enable Your Cloud Journey With Microsoft Trusted Partner | IFI Tech
Enable Your Cloud Journey With Microsoft Trusted Partner | IFI Tech
IFI Techsolutions
 
What is data visualization and how data visualization tool can help.pptx
What is data visualization and how data visualization tool can help.pptx
Varsha Nayak
 
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
BradBedford3
 
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Philip Schwarz
 
Code and No-Code Journeys: The Coverage Overlook
Code and No-Code Journeys: The Coverage Overlook
Applitools
 
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
WSO2
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Safe Software
 
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
joybepari360
 
Porting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 Webinar
ICS
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
Zoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutions
reenashriee
 
Software Testing & it’s types (DevOps)
Software Testing & it’s types (DevOps)
S Pranav (Deepu)
 
Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...
Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...
Intelli grow
 
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
soulamaabdoulaye128
 
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Alluxio, Inc.
 
Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
BradBedford3
 
How to Choose the Right Web Development Agency.pdf
How to Choose the Right Web Development Agency.pdf
Creative Fosters
 
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
Hassan Abid
 
Enable Your Cloud Journey With Microsoft Trusted Partner | IFI Tech
Enable Your Cloud Journey With Microsoft Trusted Partner | IFI Tech
IFI Techsolutions
 
What is data visualization and how data visualization tool can help.pptx
What is data visualization and how data visualization tool can help.pptx
Varsha Nayak
 
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
BradBedford3
 
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Philip Schwarz
 
Code and No-Code Journeys: The Coverage Overlook
Code and No-Code Journeys: The Coverage Overlook
Applitools
 
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
WSO2
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Safe Software
 
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
joybepari360
 
Porting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 Webinar
ICS
 
Ad

Web UI Tests: Introduce UI tests using Selenium

  • 1. Test Client & User Interface using Selenium Peyman Fakharian Hamed Salimian Software Testing Computer Department, Sharif University of Technology 2017-12 1
  • 2. Web testing  Automated testing is an extremely useful bug-killing tool for the modern Web development  Testing a Web application is a complex task  several layers of logic  test-execution framework  Web testing main parts  Database  URL- Context  HTTP requests  Client/User Interface 2
  • 3. Client Testing  Simulate GET and POST requests on a URL and observe the response  See the chain of redirects (if any) and check the URL and status code at each step.  Test that a given request is rendered with a context that contains certain values.  HTTP-based Client tests vs. in-browser frameworks 3
  • 4. HTTP-based Testing  Get/POST requests  API  Login/Register  Search  Status codes 4
  • 5. HTTP-based Testing (cont.)  Let’s see in action! 5
  • 6. Selenium  So what is Selenium?  Selenium automates browsers  automating web applications for testing purposes  automating Boring web-based administration tasks  Selenium Web Driver  create robust, browser-based regression automation suites and tests  Previously known as Selenium RC (Remote Control)  Selenium IDE  create quick bug reproduction scripts  Firefox add-on 6 Selenium available languages
  • 7. Selenium WebDriver  Driving a browser natively as a user would either locally or on a remote machine  An API driven browser  Chrome  Firefox,  Safari  IE  PhantomJS Driver  Remote web Driver 7
  • 8. Selenium (cont.)  So why we need selenium?  Simulate user interactions  Test in different browsers  AJAX applications  DO all things a user could do in a browser! Not just http requests, any thing!  Selenium is humanized!  Not only your code  Also your interactions!  Integration with different web frameworks 8
  • 9. Getting started!  Walk through the selenium docs example 9
  • 11. Testing form fields a simple regex to detect phone numbers with exact 11 digits 11
  • 12. Navigation Utilities  Selenium provides different navigation utilities  Click links  Submit forms  Drag and drop  Moving between windows  Browser history  Also provides cookies  So you can use session  Login, authentication, authorization, … made easy now! Drag & drop from selenium documentation 12
  • 13. Locating Elements  Let’s see through an example 13
  • 14. Waits capability  most of the web apps are using AJAX  if an element is not yet present in the DOM, a locate function will raise an ElementNotVisibleException exception  Waiting provides some slack between actions performed  Implicit (makes WebDriver poll the DOM for a certain amount of time)  Explicit (certain condition)  Let’s see in action! 14
  • 15. Test design  Types of tests  Static content  Links  Function tests  Ajax tests  Locating strategy  Dynamic elements  User interface mapping  makes script maintenance more efficient  more human-readable names  Database Validation 15
  • 16. Data driven testing  using the same test (or tests) multiple times with varying data  data sets are often from external files i.e. .csv  validate an application against many varying inputs  Let’s write some codes! 16
  • 17. Page object design pattern  A page object represents an area in the web application user interface that your test is interacting.  Benefits of using page object pattern:  Creating reusable code that can be shared across multiple test cases  improve readability  Reducing the amount of duplicated code  If the user interface changes, the fix needs changes in only one place  creating an object for each web page  create robust, browser-based regression automation suites and tests  By following this technique a layer of separation between the test code and technical implementation is created 17
  • 18. Page object design pattern (cont.) Image source: blazemeter tech. blog 18
  • 19. Page object design pattern (cont.)  Consist of two/three/four main parts:  Locators  Elements  Pages  Tests  Page object design pattern has been evolved in screenplay pattern.  Let’s execute some codes! 19
  • 20. Selenium grid  Selenium-Grid allows you run your tests on different machines against different browsers in parallel.  support distributed test execution  When you should use selenium grid?  To reduce the time it takes for the test suite to complete  To run your tests against multiple browsers, multiple versions of browser, and browsers running on different operating systems.  Steps:  Install selenium server/grid (jar file)  Run selenium server and create a hub  Create multiple nodes as you want 20
  • 21. Notable features  Use proxy for browser startup  Action chains  Key up, hover, key down, enter, move, etc.  Remote web-driver  Desired Capabilities  Color support Example of desired capacities 21
  • 22. Notable features (cont.)  Save/download/upload files  Custom Firefox profile  Take screenshot  All user navigations  Selenium Web Driver Custom Firefox profile 22
  • 23. Other Selenium applications  Not only for test automation  Crawl/scrape ajax based pages  Monitoring/Metric collections Examples of Yektanet ads 23
  • 24. Selenium project has a conference!  The Official 2017 European Selenium Conference  Berlin, Germany | 9–10 October  You can watch the talks in selenium YouTube channel  https://www.youtube.com/user/seleniumconf/videos 24
  • 25. Conclusion  Selenium automates browsers  automating web applications for testing purposes  You can do anything a real user does on your website  Simulate various type/version of the browsers  Great features, human readable  Introduce/develop some test design patterns 25