Selenium - Web Browser Automation
Selenium - Test automation for web applications
ANIS GHELISSI
GLS Consulting
glsconsulting@hotmail.com
November 5, 2018
Selenium - Web Browser Automation
Overview
1 Introduction to Selenium
Web applications test generalities
Selenium
2 Selenium IDE
Tests and test suites
Selenese scripts
3 Selenium WebDrive
Presentation
View Results
4 Selenium Grid
Presentation
Grid Architecture
Grid Configuration
GUI Locators
Xpath
5 Advanced usages
Selenium - Web Browser Automation
Introduction to Selenium
Web applications test generalities
Web application and testing terminology
Functionality
Usability
Interface
Compatibility
Performance
Security
Typology of tests
Selenium - Web Browser Automation
Introduction to Selenium
Selenium
Presentation
Functionalities
Architecture
Selenium - Web Browser Automation
Introduction to Selenium
Web application and testing terminology
What is web application?
What is testing for web application?
Selenium - Web Browser Automation
Introduction to Selenium
What is web application?
server side resources (PHP code, Jsp, Servlet, Java ....)
client side resources (html, javascript, css, images..)
Selenium - Web Browser Automation
Introduction to Selenium
What is testing for web application?
As for single applications testing, the objective is to look for
potential bugs in the web application.
Unit test
During development, for developers.
Instant feedback.
Easy to maintain.
End to end test
Presented to the client.
Easy to read.
Selenium - Web Browser Automation
Introduction to Selenium
Functionality
Links
Forms
Html/Css validation
Data
Selenium - Web Browser Automation
Introduction to Selenium
Functionality
check all the links(internal/external/mail)
check all the forms(validation, messages
(error,confirmation,...),mandatory and optional fields)
Html/Css validation (https://validator.w3.org/)
Data Consistency/ Data Integrity
Selenium - Web Browser Automation
Introduction to Selenium
Usability
Learning curve
Ease of navigation
Content consistency
Selenium - Web Browser Automation
Introduction to Selenium
Usability
how to measure the interaction between the person and the web
application.
ease of navigation (complex web interface vs simple web
interface/how many clicks do I need to get the job done/ the
user expect the web application to be easy to use).
content consistency(main menu should be visible on all pages,
avoid annoying colors and fonts, image placement should be
nifty, whenever you encounter an anchored text you would
expect it to work properly etc.... ).
Selenium - Web Browser Automation
Introduction to Selenium
Interface
Web Server
Database
Selenium - Web Browser Automation
Introduction to Selenium
Interface
The web application should be able to interact properly with the
server side including the database, the network and the database
Selenium - Web Browser Automation
Introduction to Selenium
Compatibility
Selenium - Web Browser Automation
Introduction to Selenium
Performance
Load test
many users are loading the same page, simultaneous user
requests,heavy load ...
Selenium - Web Browser Automation
Introduction to Selenium
Performance
Stress test
Push the web application to it’s limits to observe how it
behaves, how it recovers.
Generally input fields are pushed the most.
Performed on different operating systems and different
hardware to detect flaws like potential memory leaks.
Could be used to measure scalability.
Selenium - Web Browser Automation
Introduction to Selenium
Security
Access
if you have different level of user access, you should check that
only the authorized users could view only the content at their
level.
Other related security tests
vulnerability, password cracking, viruses and malware
detection..
Selenium - Web Browser Automation
Introduction to Selenium
Selenium presentation
Cross browsers
Many languages
Selenium - Web Browser Automation
Introduction to Selenium
Selenium functionalities
Record/playback tests
Write specific tests - Selenium API
Launch remote tests
Selenium - Web Browser Automation
Introduction to Selenium
Selenium architecture
IDE
WebDrive
Grid
Selenium - Web Browser Automation
Selenium IDE
Tests and test suites
Record and playback
Integrated development environment that exists in the form of an
extension to the browser(firefox, chrome).
FireFox/Chrome plugin
Save as a test
Group tests as test suites
Selenium - Web Browser Automation
Selenium IDE
Selenese scripts
Selenese scripts
Command
Target
Value
Selenium - Web Browser Automation
Selenium WebDrive
Presentation
WebDrive
Integrate Selenium to your code
Multiplutform
Specific driver for navigator
Selenium - Web Browser Automation
Selenium WebDrive
View Results
How to evaluate results
Java Context, Junit / TestNG
IDE (IDA Intellij used in this session)
Selenium - Web Browser Automation
Selenium Grid
Presentation
Selenium Grid Presentation
Scale
Manage multiple environments
Minimize the maintenance time
Selenium - Web Browser Automation
Selenium Grid
Grid Architecture
Selenium Grid Architecture
Hub
Nodes
Jar file
Java commands
Selenium - Web Browser Automation
Selenium Grid
Grid Configuration
Grid Configuration
http://localhost:4444/grid/console
Selenium - Web Browser Automation
Selenium Grid
GUI Locators
GUI locator
Hyperlink
Id
name
Css
Selenium - Web Browser Automation
Selenium Grid
Xpath
Xpath
Node selection in xml documents
Used in html to locate elements in DOM
Selenium - Web Browser Automation
Selenium Grid
Xpath
Xpath Selection
By Tag
By Attribute
By Tag content
Selenium - Web Browser Automation
Selenium Grid
Xpath
Xpath Selection
By Tag
By Attribute
By Tag content
Selenium - Web Browser Automation
Advanced usages
Selenium - Web Browser Automation
Advanced usages
The End

Selenium -Test automation for web applications

  • 1.
    Selenium - WebBrowser Automation Selenium - Test automation for web applications ANIS GHELISSI GLS Consulting glsconsulting@hotmail.com November 5, 2018
  • 2.
    Selenium - WebBrowser Automation Overview 1 Introduction to Selenium Web applications test generalities Selenium 2 Selenium IDE Tests and test suites Selenese scripts 3 Selenium WebDrive Presentation View Results 4 Selenium Grid Presentation Grid Architecture Grid Configuration GUI Locators Xpath 5 Advanced usages
  • 3.
    Selenium - WebBrowser Automation Introduction to Selenium Web applications test generalities Web application and testing terminology Functionality Usability Interface Compatibility Performance Security Typology of tests
  • 4.
    Selenium - WebBrowser Automation Introduction to Selenium Selenium Presentation Functionalities Architecture
  • 5.
    Selenium - WebBrowser Automation Introduction to Selenium Web application and testing terminology What is web application? What is testing for web application?
  • 6.
    Selenium - WebBrowser Automation Introduction to Selenium What is web application? server side resources (PHP code, Jsp, Servlet, Java ....) client side resources (html, javascript, css, images..)
  • 7.
    Selenium - WebBrowser Automation Introduction to Selenium What is testing for web application? As for single applications testing, the objective is to look for potential bugs in the web application. Unit test During development, for developers. Instant feedback. Easy to maintain. End to end test Presented to the client. Easy to read.
  • 8.
    Selenium - WebBrowser Automation Introduction to Selenium Functionality Links Forms Html/Css validation Data
  • 9.
    Selenium - WebBrowser Automation Introduction to Selenium Functionality check all the links(internal/external/mail) check all the forms(validation, messages (error,confirmation,...),mandatory and optional fields) Html/Css validation (https://validator.w3.org/) Data Consistency/ Data Integrity
  • 10.
    Selenium - WebBrowser Automation Introduction to Selenium Usability Learning curve Ease of navigation Content consistency
  • 11.
    Selenium - WebBrowser Automation Introduction to Selenium Usability how to measure the interaction between the person and the web application. ease of navigation (complex web interface vs simple web interface/how many clicks do I need to get the job done/ the user expect the web application to be easy to use). content consistency(main menu should be visible on all pages, avoid annoying colors and fonts, image placement should be nifty, whenever you encounter an anchored text you would expect it to work properly etc.... ).
  • 12.
    Selenium - WebBrowser Automation Introduction to Selenium Interface Web Server Database
  • 13.
    Selenium - WebBrowser Automation Introduction to Selenium Interface The web application should be able to interact properly with the server side including the database, the network and the database
  • 14.
    Selenium - WebBrowser Automation Introduction to Selenium Compatibility
  • 15.
    Selenium - WebBrowser Automation Introduction to Selenium Performance Load test many users are loading the same page, simultaneous user requests,heavy load ...
  • 16.
    Selenium - WebBrowser Automation Introduction to Selenium Performance Stress test Push the web application to it’s limits to observe how it behaves, how it recovers. Generally input fields are pushed the most. Performed on different operating systems and different hardware to detect flaws like potential memory leaks. Could be used to measure scalability.
  • 17.
    Selenium - WebBrowser Automation Introduction to Selenium Security Access if you have different level of user access, you should check that only the authorized users could view only the content at their level. Other related security tests vulnerability, password cracking, viruses and malware detection..
  • 18.
    Selenium - WebBrowser Automation Introduction to Selenium Selenium presentation Cross browsers Many languages
  • 19.
    Selenium - WebBrowser Automation Introduction to Selenium Selenium functionalities Record/playback tests Write specific tests - Selenium API Launch remote tests
  • 20.
    Selenium - WebBrowser Automation Introduction to Selenium Selenium architecture IDE WebDrive Grid
  • 21.
    Selenium - WebBrowser Automation Selenium IDE Tests and test suites Record and playback Integrated development environment that exists in the form of an extension to the browser(firefox, chrome). FireFox/Chrome plugin Save as a test Group tests as test suites
  • 22.
    Selenium - WebBrowser Automation Selenium IDE Selenese scripts Selenese scripts Command Target Value
  • 23.
    Selenium - WebBrowser Automation Selenium WebDrive Presentation WebDrive Integrate Selenium to your code Multiplutform Specific driver for navigator
  • 24.
    Selenium - WebBrowser Automation Selenium WebDrive View Results How to evaluate results Java Context, Junit / TestNG IDE (IDA Intellij used in this session)
  • 25.
    Selenium - WebBrowser Automation Selenium Grid Presentation Selenium Grid Presentation Scale Manage multiple environments Minimize the maintenance time
  • 26.
    Selenium - WebBrowser Automation Selenium Grid Grid Architecture Selenium Grid Architecture Hub Nodes Jar file Java commands
  • 27.
    Selenium - WebBrowser Automation Selenium Grid Grid Configuration Grid Configuration http://localhost:4444/grid/console
  • 28.
    Selenium - WebBrowser Automation Selenium Grid GUI Locators GUI locator Hyperlink Id name Css
  • 29.
    Selenium - WebBrowser Automation Selenium Grid Xpath Xpath Node selection in xml documents Used in html to locate elements in DOM
  • 30.
    Selenium - WebBrowser Automation Selenium Grid Xpath Xpath Selection By Tag By Attribute By Tag content
  • 31.
    Selenium - WebBrowser Automation Selenium Grid Xpath Xpath Selection By Tag By Attribute By Tag content
  • 32.
    Selenium - WebBrowser Automation Advanced usages
  • 33.
    Selenium - WebBrowser Automation Advanced usages The End