SlideShare a Scribd company logo
Automated Layout Testing Using
Galen Framework
Galen Framework
1. Galen framework offers a simple solution for
testing page layout
2. It uses Selenium Web Driver for getting element’s
position in browser. Galen receives element’s
position, width and height. After that, Galen verifies
elements relative to each other on the page.
3. It has flexible Java support
4. Galen has its own file format, with the help of
which you can describe complex layout
Galen Framework & Java Support
1. Simplest usage of Galen framework is to extend
GalenTestNgTestBase class
2. You can pass your own Selenium Web Driver
instance to Galen.checkLayout() method
3. Galen can take screenshots of pages, which it
verifies
4. Galen can export all test reports to html file for
demonstrative results
Structure of GSPEC file
Objects
definition
Groups
definition
Variables
definition
Declare
section(s)
Declare
common
tag ‘*’
Declare
necessary
tags
Add web
elements
verifications
Add
comments,
if needed
Structure of GSPEC file
‘@objects’ – keyword for locators definition. Each
.gspec file should normally starts with this keyword.
There are 3 available locators for describing web
element on page: xpath, id and css.
‘= Main section =‘ - section definition. Sections are very
useful for understanding the structure of gspec file.
There are some callback methods in ValidationListener
interface, which connected with section’s events.
‘@on’ – verification filter or tag. If some
verifications have conditions, you can mark them
with tag and pass it to Galen.checkLayout() method.
Structure of GSPEC file
@objects
# Common elements
loginButton xpath //div[@id=‘login’]
forgotPassword id uidForgotPasswordLink
content css #content div
# Desktop elements
signInLink id signInLink
= Main section =
# @on tablet_portrait, mobile_landscape, desktop,
@on *
forgotPassword:
inside content
Advanced objects definition
You can define one or more web elements into a specific
group, as shown below:
@objects
header css #header
menu css #menu
content css #content
footer css #footer
@groups
skeleton_elements header, menu, content, footer
= Skeleton =
&skeleton_elements:
inside screen 0px left right
Web elements verification. Ranges
You can verify the width and height of element as
follows:
width 10 px | height 10 px
width 50 to 100 px | height 50 to 100 px
width > 30 px | height > 30 px
width < 40 px | height < 40 px
width ~ 10 px | height ~ 10 px
Also, Galen can check relative values by using ‘%’
symbols:
width 50 % of screen/width
Web elements verification. Common
There are a lot of keywords for page layout verification,
such as: ‘near’, ‘below’, ‘above’, ‘inside’, ‘aligned’, ‘text’,
‘contains’, ‘color-scheme’ and etc.
textfield:
right-of button 5 px
above button 5 to 10 px
near button 10px left
near button 5px bottom left
inside container
aligned vertically left
text ends “galen!"
absent
Web elements verification. Variables
Galen provides possibility to use common values for
different specs
@set
commonHeaderMargin 10 to 20px
contentMargin ~ 20px
= Header =
header_icon:
inside header ${commonHeaderMargin}
top left
= Content =
article-description:
inside main ${contentMargin} left right
Web elements verification. Addition
1. You can also use loops for object groups (e.g.
@forEach [&mainframe] as item)
2. You can also create your own verification functions
and use them with ‘|’ symbol (e.g. @rule should be
squared width 100% of ${objectName}/height)
3. You can also create your own JavaScript functions and
use them as verification attribute
4. You can also declare conditional checks using
JavaScript expressions (e.g. @if $(isVisible(“banner-1”)))
Galen Framework. HtmlBuilder
Galen also provides possibility for saving validation
results to external HTML file.
GalenTestInfo test =GalenTestInfo.fromString("Login
page on mobile device test");
test.getReport().layout(layoutReport, "check layout
on mobile device");
tests.add(test);
new HtmlReportBuilder().build(tests,"target/galen-
html-reports");
Galen Framework. HtmlBuilder
Galen Framework
Visit Sperasoft online:
www.sperasoft.com
www.facebook.com/Sperasoft
www.twitter.com/Sperasoft

More Related Content

What's hot (18)

Introduction To Web Application Testing
Introduction To Web Application Testing
Ynon Perek
 
5 x HTML5 worth using in APEX (5)
5 x HTML5 worth using in APEX (5)
Christian Rokitta
 
Catalog display
Catalog display
Jason Noble
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
Sargis Sargsyan
 
Angular Classy
Angular Classy
Dave Jeffery
 
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Brandon Keepers
 
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
Applitools
 
Selenium (2)
Selenium (2)
onlinemindq
 
Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...
Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...
Iakiv Kramarenko
 
CUCUMBER - Making BDD Fun
CUCUMBER - Making BDD Fun
SQABD
 
App engine beats pony.key
App engine beats pony.key
Alper Çugun
 
JS Frameworks - Angular Vs Backbone
JS Frameworks - Angular Vs Backbone
Gourav Jain, MCTS®
 
AngularJS Best Practices
AngularJS Best Practices
Narek Mamikonyan
 
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
 
Why angular js Framework
Why angular js Framework
Sakthi Bro
 
How angularjs saves rails
How angularjs saves rails
Michael He
 
Bdd with Cucumber and Mocha
Bdd with Cucumber and Mocha
Atish Narlawar
 
Cucumber & gherkin language
Cucumber & gherkin language
selvanathankapilan
 
Introduction To Web Application Testing
Introduction To Web Application Testing
Ynon Perek
 
5 x HTML5 worth using in APEX (5)
5 x HTML5 worth using in APEX (5)
Christian Rokitta
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
Sargis Sargsyan
 
Behavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Brandon Keepers
 
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
Applitools
 
Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...
Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...
Iakiv Kramarenko
 
CUCUMBER - Making BDD Fun
CUCUMBER - Making BDD Fun
SQABD
 
App engine beats pony.key
App engine beats pony.key
Alper Çugun
 
JS Frameworks - Angular Vs Backbone
JS Frameworks - Angular Vs Backbone
Gourav Jain, MCTS®
 
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
 
Why angular js Framework
Why angular js Framework
Sakthi Bro
 
How angularjs saves rails
How angularjs saves rails
Michael He
 
Bdd with Cucumber and Mocha
Bdd with Cucumber and Mocha
Atish Narlawar
 

Viewers also liked (9)

Galenframework
Galenframework
Deepshikha Singh
 
Galen
Galen
Frence Babatuan
 
Advanced Appium: SeleniumConf UK 2016
Advanced Appium: SeleniumConf UK 2016
Dan Cuellar
 
Automating the responsive website testing
Automating the responsive website testing
Birudugadda Pranathi
 
Testing responsive web design pdf
Testing responsive web design pdf
crilusi
 
Testing Responsive Webdesign
Testing Responsive Webdesign
Sven Wolfermann
 
Cross browser testing using BrowserStack
Cross browser testing using BrowserStack
RapidValue
 
Responsive Web Design testing using Galen Framework
Responsive Web Design testing using Galen Framework
Birudugadda Pranathi
 
A Complete Guide to Testing Responsive Websites
A Complete Guide to Testing Responsive Websites
Perfecto by Perforce
 
Advanced Appium: SeleniumConf UK 2016
Advanced Appium: SeleniumConf UK 2016
Dan Cuellar
 
Automating the responsive website testing
Automating the responsive website testing
Birudugadda Pranathi
 
Testing responsive web design pdf
Testing responsive web design pdf
crilusi
 
Testing Responsive Webdesign
Testing Responsive Webdesign
Sven Wolfermann
 
Cross browser testing using BrowserStack
Cross browser testing using BrowserStack
RapidValue
 
Responsive Web Design testing using Galen Framework
Responsive Web Design testing using Galen Framework
Birudugadda Pranathi
 
A Complete Guide to Testing Responsive Websites
A Complete Guide to Testing Responsive Websites
Perfecto by Perforce
 
Ad

Similar to Automated layout testing using Galen Framework (6)

Galenframework
Galenframework
Deepshikha Singh
 
[Srijan Wednesday Webinars] Automating Visual Regression using ‘Galen’
[Srijan Wednesday Webinars] Automating Visual Regression using ‘Galen’
Srijan Technologies
 
Layout testing with galen framework
Layout testing with galen framework
Can YILDIRIM
 
Responsive testing
Responsive testing
Devi Sridharan
 
Rare frontend testing
Rare frontend testing
Андрей Вандакуров
 
Using galen framework for automated cross browser layout testing
Using galen framework for automated cross browser layout testing
Sarah Elson
 
[Srijan Wednesday Webinars] Automating Visual Regression using ‘Galen’
[Srijan Wednesday Webinars] Automating Visual Regression using ‘Galen’
Srijan Technologies
 
Layout testing with galen framework
Layout testing with galen framework
Can YILDIRIM
 
Using galen framework for automated cross browser layout testing
Using galen framework for automated cross browser layout testing
Sarah Elson
 
Ad

More from Sperasoft (20)

особенности работы с Locomotion в Unreal Engine 4
особенности работы с Locomotion в Unreal Engine 4
Sperasoft
 
концепт и архитектура геймплея в Creach: The Depleted World
концепт и архитектура геймплея в Creach: The Depleted World
Sperasoft
 
Опыт разработки VR игры для UE4
Опыт разработки VR игры для UE4
Sperasoft
 
Организация работы с UE4 в команде до 20 человек
Организация работы с UE4 в команде до 20 человек
Sperasoft
 
Gameplay Tags
Gameplay Tags
Sperasoft
 
Data Driven Gameplay in UE4
Data Driven Gameplay in UE4
Sperasoft
 
Code and Memory Optimisation Tricks
Code and Memory Optimisation Tricks
Sperasoft
 
The theory of relational databases
The theory of relational databases
Sperasoft
 
Sperasoft talks: Android Security Threats
Sperasoft talks: Android Security Threats
Sperasoft
 
Sperasoft Talks: RxJava Functional Reactive Programming on Android
Sperasoft Talks: RxJava Functional Reactive Programming on Android
Sperasoft
 
Sperasoft‬ talks j point 2015
Sperasoft‬ talks j point 2015
Sperasoft
 
Effective Мeetings
Effective Мeetings
Sperasoft
 
Unreal Engine 4 Introduction
Unreal Engine 4 Introduction
Sperasoft
 
JIRA Development
JIRA Development
Sperasoft
 
Introduction to Elasticsearch
Introduction to Elasticsearch
Sperasoft
 
MOBILE DEVELOPMENT with HTML, CSS and JS
MOBILE DEVELOPMENT with HTML, CSS and JS
Sperasoft
 
Quick Intro Into Kanban
Quick Intro Into Kanban
Sperasoft
 
ECMAScript 6 Review
ECMAScript 6 Review
Sperasoft
 
Console Development in 15 minutes
Console Development in 15 minutes
Sperasoft
 
Database Indexes
Database Indexes
Sperasoft
 
особенности работы с Locomotion в Unreal Engine 4
особенности работы с Locomotion в Unreal Engine 4
Sperasoft
 
концепт и архитектура геймплея в Creach: The Depleted World
концепт и архитектура геймплея в Creach: The Depleted World
Sperasoft
 
Опыт разработки VR игры для UE4
Опыт разработки VR игры для UE4
Sperasoft
 
Организация работы с UE4 в команде до 20 человек
Организация работы с UE4 в команде до 20 человек
Sperasoft
 
Gameplay Tags
Gameplay Tags
Sperasoft
 
Data Driven Gameplay in UE4
Data Driven Gameplay in UE4
Sperasoft
 
Code and Memory Optimisation Tricks
Code and Memory Optimisation Tricks
Sperasoft
 
The theory of relational databases
The theory of relational databases
Sperasoft
 
Sperasoft talks: Android Security Threats
Sperasoft talks: Android Security Threats
Sperasoft
 
Sperasoft Talks: RxJava Functional Reactive Programming on Android
Sperasoft Talks: RxJava Functional Reactive Programming on Android
Sperasoft
 
Sperasoft‬ talks j point 2015
Sperasoft‬ talks j point 2015
Sperasoft
 
Effective Мeetings
Effective Мeetings
Sperasoft
 
Unreal Engine 4 Introduction
Unreal Engine 4 Introduction
Sperasoft
 
JIRA Development
JIRA Development
Sperasoft
 
Introduction to Elasticsearch
Introduction to Elasticsearch
Sperasoft
 
MOBILE DEVELOPMENT with HTML, CSS and JS
MOBILE DEVELOPMENT with HTML, CSS and JS
Sperasoft
 
Quick Intro Into Kanban
Quick Intro Into Kanban
Sperasoft
 
ECMAScript 6 Review
ECMAScript 6 Review
Sperasoft
 
Console Development in 15 minutes
Console Development in 15 minutes
Sperasoft
 
Database Indexes
Database Indexes
Sperasoft
 

Recently uploaded (20)

ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance
 
PyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent Integration
barqawicloud
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Introduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUE
Google Developer Group On Campus European Universities in Egypt
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...
Matsushita Laboratory
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance
 
PyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent Integration
barqawicloud
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...
Matsushita Laboratory
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 

Automated layout testing using Galen Framework

  • 1. Automated Layout Testing Using Galen Framework
  • 2. Galen Framework 1. Galen framework offers a simple solution for testing page layout 2. It uses Selenium Web Driver for getting element’s position in browser. Galen receives element’s position, width and height. After that, Galen verifies elements relative to each other on the page. 3. It has flexible Java support 4. Galen has its own file format, with the help of which you can describe complex layout
  • 3. Galen Framework & Java Support 1. Simplest usage of Galen framework is to extend GalenTestNgTestBase class 2. You can pass your own Selenium Web Driver instance to Galen.checkLayout() method 3. Galen can take screenshots of pages, which it verifies 4. Galen can export all test reports to html file for demonstrative results
  • 4. Structure of GSPEC file Objects definition Groups definition Variables definition Declare section(s) Declare common tag ‘*’ Declare necessary tags Add web elements verifications Add comments, if needed
  • 5. Structure of GSPEC file ‘@objects’ – keyword for locators definition. Each .gspec file should normally starts with this keyword. There are 3 available locators for describing web element on page: xpath, id and css. ‘= Main section =‘ - section definition. Sections are very useful for understanding the structure of gspec file. There are some callback methods in ValidationListener interface, which connected with section’s events. ‘@on’ – verification filter or tag. If some verifications have conditions, you can mark them with tag and pass it to Galen.checkLayout() method.
  • 6. Structure of GSPEC file @objects # Common elements loginButton xpath //div[@id=‘login’] forgotPassword id uidForgotPasswordLink content css #content div # Desktop elements signInLink id signInLink = Main section = # @on tablet_portrait, mobile_landscape, desktop, @on * forgotPassword: inside content
  • 7. Advanced objects definition You can define one or more web elements into a specific group, as shown below: @objects header css #header menu css #menu content css #content footer css #footer @groups skeleton_elements header, menu, content, footer = Skeleton = &skeleton_elements: inside screen 0px left right
  • 8. Web elements verification. Ranges You can verify the width and height of element as follows: width 10 px | height 10 px width 50 to 100 px | height 50 to 100 px width > 30 px | height > 30 px width < 40 px | height < 40 px width ~ 10 px | height ~ 10 px Also, Galen can check relative values by using ‘%’ symbols: width 50 % of screen/width
  • 9. Web elements verification. Common There are a lot of keywords for page layout verification, such as: ‘near’, ‘below’, ‘above’, ‘inside’, ‘aligned’, ‘text’, ‘contains’, ‘color-scheme’ and etc. textfield: right-of button 5 px above button 5 to 10 px near button 10px left near button 5px bottom left inside container aligned vertically left text ends “galen!" absent
  • 10. Web elements verification. Variables Galen provides possibility to use common values for different specs @set commonHeaderMargin 10 to 20px contentMargin ~ 20px = Header = header_icon: inside header ${commonHeaderMargin} top left = Content = article-description: inside main ${contentMargin} left right
  • 11. Web elements verification. Addition 1. You can also use loops for object groups (e.g. @forEach [&mainframe] as item) 2. You can also create your own verification functions and use them with ‘|’ symbol (e.g. @rule should be squared width 100% of ${objectName}/height) 3. You can also create your own JavaScript functions and use them as verification attribute 4. You can also declare conditional checks using JavaScript expressions (e.g. @if $(isVisible(“banner-1”)))
  • 12. Galen Framework. HtmlBuilder Galen also provides possibility for saving validation results to external HTML file. GalenTestInfo test =GalenTestInfo.fromString("Login page on mobile device test"); test.getReport().layout(layoutReport, "check layout on mobile device"); tests.add(test); new HtmlReportBuilder().build(tests,"target/galen- html-reports");
  • 14. Galen Framework Visit Sperasoft online: www.sperasoft.com www.facebook.com/Sperasoft www.twitter.com/Sperasoft