SlideShare a Scribd company logo
1 of 19
Download to read offline
Geb 
very groovy browser automation 
http://www.gebish.org 1 / 19
Agenda 
1. Introduction to Geb 
WebDriver 
Test framework integrations 
Navigation API 
Page objects 
Module objects 
Content DSL 
Multiple Environments 
2. Our project-setup 
2 / 19
Introduction 
Automating the interaction between web browsers and web content 
Acceptance Testing Web Applications 
Screen scraping 
Great documentation: http://www.gebish.org/manual/current/ 
3 / 19
Example 
geb.Browser 
Browser.drive { 
go "http://myapp.com/login" 
$("h1").text() == "Please Login" 
$("form.login"). { 
username = "admin" 
password = "password" 
login().click() 
} 
$("h1").text() == "Admin Section" 
} 
4 / 19
Technology 
WebDriver (support many browsers) 
Groovy (remove java-boilerplate) 
Spock, JUnit or TestNG (easy to integrate with IDE and build systems) 
Navigator API (jQuery-like content selection) 
5 / 19
WebDriver 
Geb builds on the WebDriver browser automation librar 
Geb can work with any browser that WebDriver can 
Geb provides an abstraction layer, but you can access WebDriver directly 
Geb never talks to the actual browser. 
You need specific driver for each browser you want to work with: 
< > 
< >org.seleniumhq.selenium</ > 
< >selenium-firefox-driver</ > 
< >2.20.0</ > 
</ > 
6 / 19
Test framework integration 
Geb works with existing popular tools like Spock, JUnit, TestNG and 
Cucumber. 
You pick what you like; but Geb encurages Spock. 
7 / 19
Spock example 
geb.spock.GebSpec 
{ 
"first result for wikipedia search should be wikipedia"() { 
given: 
to GoogleHomePage 
expect: 
at GoogleHomePage 
when: 
search.field.value("wikipedia") 
then: 
waitFor { at GoogleResultsPage } 
} 
} 
More about Spock @ https://code.google.com/p/spock/ 8 / 19
Navigator API 
Inspired by jQuery. 
Content is selected via the $ function, which returns a Navigator object 
Makes it super easy to select content 
// match all 'div' elements on the page 
$("div") 
// match the first 'div' element on the page 
$("div", 0) 
// match all 'div' elements with a title attribute value of 'section' 
$("div", title: "section") 
// The parent of the first paragraph 
$("p", 0).parent() 
//<div>foo</div> 
$("div", text: "foo") 
// Using patterns 
$("p", text: ~/p./).size() == 2 
$("p", text: startsWith("p")).size() == 2 
http://www.gebish.org/manual/current/intro.html#the_jquery_ish_navigator_api 9 / 19
Page Objects 
Less fragile code with better abstractions and modelling 
Promotes resuse 
Makes it easier to write tests 
Pages (and modules) can be arranged in inheritance hierarchies. 
Within your web app’s UI there are areas that your tests interact with. A 
Page Object simply models these as objects within the test code. This reduces 
the amount of duplicated code and means that if the UI changes, the fix need 
only be applied in one place. (webdriver...) 
10 / 19
Page Objects: example 
{ 
url = "/login" 
at = { title == "Login to our super page" } 
content = { 
loginButton(to: AdminPage) { $("input", type: "submit", name: "login") } 
} 
} 
{ 
at = { 
assert $("h1").text() == "Admin Page" 
} 
} 
Browser.drive { 
to LoginPage 
loginButton.click() 
at AdminPage 
} 
to changes the browser’s page instance. 
click on login-button changes page to the "Admin page" 
at explicitly asserts that we are on the expected page 
11 / 19
Module Objects 
Reusable fragments that can be used across pages 
Useful for modelling things like UI widgets that are used across multiple 
pages 
We can define a Navigator context when including the module in a Page. 
Module will then only see "its own part" of the dom via the navigator api 
12 / 19
Module Objects: example 
{ 
content = { 
button { $("input", type: "submit") } 
} 
} 
{ 
content = { 
theModule { module ExampleModule } 
} 
} 
Browser.drive { 
to ExamplePage 
theModule.button.click() 
} 
13 / 19
Content DSL 
Content definitions can build upon each other. 
Content definitions are actually templates. 
{ 
content = { 
results { $("li.g") } 
result { i -> results[i] } 
resultLink { i -> result(i).find("a.l", 0) } 
firstResultLink { resultLink(0) } 
} 
} 
Optional Content 
{ 
content = { 
errorMsg(required: ) { $("p.errorMsg") } 
} 
} 
14 / 19
Dynamic content 
{ 
content = { 
linkTotrigger {$("a"} 
awesomeContainer(required: ) { $("div.awesome") } 
} 
} 
Browser.drive { 
to DynamicPage 
linkTotrigger.click() 
waitFor { awesomeContainer } 
} 
By default, it will look for it every 100ms for 5s before giving up. 
15 / 19
Multiple Environments 
The Groovy ConfigSlurper mechanism has built in support for 
environment sensitive configuration 
system property to determine the environment to use 
remoteDriver = {..} 
driver = { FirefoxDriver() } 
baseUrl = "http://iad.finn.no:3002/" 
iadUrl = "http://dev.finn.no" 
environments { 
'dev' { 
baseUrl = "http://dev.finn.no/talent/" 
iadUrl = "http://dev.finn.no" 
driver = remoteDriver 
} 
'prod' { 
baseUrl = "http://www.finn.no/talent/" 
iadUrl = "http://www.finn.no" 
driver = remoteDriver 
} 
} 
16 / 19
Our project-setup 
Kjører tester lokalt mot lokal server 
Kan kjøre tester som en del av maven-bygget 
men valgt å ikke gjøre dette siden vi er avhengig av finndev-login-tjensten 
Sparker i gang en testkjøring mot dev straks en ny artifakt er deployet i 
dev. 
17 / 19
FINN.no :: Testreports 
JUnit-listner that intgrates Geb with http://testreports.finn.no 
Support @Tags annotation 
Gives status and screenshots for each test 
Easy setup with the maven-surfire-plugin 
< > 
< >org.apache.maven.plugins</ > 
< >maven-surefire-plugin</ > 
< >2.16</ > 
< > 
< > 
< >**/*Spec.*</ > 
</ > 
< > 
< >target/test-reports/geb</ > 
< >${artifactId}</ > 
</ > 
< > 
< > 
< >listener</ > 
< >no.finntech.test.report.runner.GebTestReportRunListener</ > 
</ > 
</ > 18 / 19
Demo time 
19 / 19

More Related Content

What's hot

B.Tech Consolidated Marks Memo
B.Tech Consolidated Marks MemoB.Tech Consolidated Marks Memo
B.Tech Consolidated Marks Memosarath chandra
 
04.arabic writing for beginners
04.arabic writing for beginners04.arabic writing for beginners
04.arabic writing for beginnersMohammad Ali
 
Mechanical engineering certificate
Mechanical engineering certificateMechanical engineering certificate
Mechanical engineering certificateMohammedNizam23
 
BT Degree(Mumbai University)
BT Degree(Mumbai University)BT Degree(Mumbai University)
BT Degree(Mumbai University)manu786
 
Imamia jantri 2016 aiourdubooks.net
Imamia jantri 2016 aiourdubooks.netImamia jantri 2016 aiourdubooks.net
Imamia jantri 2016 aiourdubooks.netImran Ahmed Farooq
 
BA Certificate - IGNOU
BA Certificate - IGNOUBA Certificate - IGNOU
BA Certificate - IGNOUBobby Gabriel
 
The Complete Guide to Lazy Loading
The Complete Guide to Lazy LoadingThe Complete Guide to Lazy Loading
The Complete Guide to Lazy LoadingSakha Global
 
Surah Hamim as Sajdah
Surah Hamim as SajdahSurah Hamim as Sajdah
Surah Hamim as SajdahAzaakhaana
 
Best practices for developing your Magento Commerce on Cloud
Best practices for developing your Magento Commerce on CloudBest practices for developing your Magento Commerce on Cloud
Best practices for developing your Magento Commerce on CloudOleg Posyniak
 
Catálogo Geral Giannini 2000
Catálogo Geral Giannini 2000Catálogo Geral Giannini 2000
Catálogo Geral Giannini 2000Roberto Fontanezi
 
445 samoubilacki eskadron
445  samoubilacki eskadron445  samoubilacki eskadron
445 samoubilacki eskadronMilenko Gavric
 
Manual de Usuario Renault 9/11 (1985)
Manual de Usuario Renault 9/11 (1985)Manual de Usuario Renault 9/11 (1985)
Manual de Usuario Renault 9/11 (1985)AmigosRenault9Arg
 
University of Cambridge Certificate of Proficiency in English
University of Cambridge Certificate of Proficiency in EnglishUniversity of Cambridge Certificate of Proficiency in English
University of Cambridge Certificate of Proficiency in EnglishMatteo Anesin
 

What's hot (20)

Quran with Tajwid Surah 3 ﴾القرآن سورۃ آل عمران﴿ Aal Imran 🙪 PDF
Quran with Tajwid Surah 3 ﴾القرآن سورۃ آل عمران﴿ Aal Imran 🙪 PDFQuran with Tajwid Surah 3 ﴾القرآن سورۃ آل عمران﴿ Aal Imran 🙪 PDF
Quran with Tajwid Surah 3 ﴾القرآن سورۃ آل عمران﴿ Aal Imran 🙪 PDF
 
B.Tech Consolidated Marks Memo
B.Tech Consolidated Marks MemoB.Tech Consolidated Marks Memo
B.Tech Consolidated Marks Memo
 
04.arabic writing for beginners
04.arabic writing for beginners04.arabic writing for beginners
04.arabic writing for beginners
 
DIPLOMA FINAL MARKSHEET
DIPLOMA FINAL MARKSHEETDIPLOMA FINAL MARKSHEET
DIPLOMA FINAL MARKSHEET
 
Mechanical engineering certificate
Mechanical engineering certificateMechanical engineering certificate
Mechanical engineering certificate
 
BT Degree(Mumbai University)
BT Degree(Mumbai University)BT Degree(Mumbai University)
BT Degree(Mumbai University)
 
Imamia jantri 2016 aiourdubooks.net
Imamia jantri 2016 aiourdubooks.netImamia jantri 2016 aiourdubooks.net
Imamia jantri 2016 aiourdubooks.net
 
BA Certificate - IGNOU
BA Certificate - IGNOUBA Certificate - IGNOU
BA Certificate - IGNOU
 
Surah An'am
Surah An'amSurah An'am
Surah An'am
 
Surah Waqiah
Surah WaqiahSurah Waqiah
Surah Waqiah
 
The Complete Guide to Lazy Loading
The Complete Guide to Lazy LoadingThe Complete Guide to Lazy Loading
The Complete Guide to Lazy Loading
 
Surah Hamim as Sajdah
Surah Hamim as SajdahSurah Hamim as Sajdah
Surah Hamim as Sajdah
 
B787 Navigation systems
B787 Navigation systemsB787 Navigation systems
B787 Navigation systems
 
Best practices for developing your Magento Commerce on Cloud
Best practices for developing your Magento Commerce on CloudBest practices for developing your Magento Commerce on Cloud
Best practices for developing your Magento Commerce on Cloud
 
Catálogo Geral Giannini 2000
Catálogo Geral Giannini 2000Catálogo Geral Giannini 2000
Catálogo Geral Giannini 2000
 
445 samoubilacki eskadron
445  samoubilacki eskadron445  samoubilacki eskadron
445 samoubilacki eskadron
 
Manual de Usuario Renault 9/11 (1985)
Manual de Usuario Renault 9/11 (1985)Manual de Usuario Renault 9/11 (1985)
Manual de Usuario Renault 9/11 (1985)
 
Quran with Tajwid Surah 92 ﴾القرآن سورۃ الليل﴿ Al-Lail 🙪 PDF
Quran with Tajwid Surah 92 ﴾القرآن سورۃ الليل﴿ Al-Lail 🙪 PDFQuran with Tajwid Surah 92 ﴾القرآن سورۃ الليل﴿ Al-Lail 🙪 PDF
Quran with Tajwid Surah 92 ﴾القرآن سورۃ الليل﴿ Al-Lail 🙪 PDF
 
University of Cambridge Certificate of Proficiency in English
University of Cambridge Certificate of Proficiency in EnglishUniversity of Cambridge Certificate of Proficiency in English
University of Cambridge Certificate of Proficiency in English
 
B787 Pressurization
B787 PressurizationB787 Pressurization
B787 Pressurization
 

Viewers also liked

Cloud browser testing with Gradle and Geb
Cloud browser testing with Gradle and GebCloud browser testing with Gradle and Geb
Cloud browser testing with Gradle and GebDavid Carr
 
Java beyond Java - from the language to platform
Java beyond Java - from the language to platformJava beyond Java - from the language to platform
Java beyond Java - from the language to platformNaresha K
 
Design Patterns from 10K feet
Design Patterns from 10K feetDesign Patterns from 10K feet
Design Patterns from 10K feetNaresha K
 
Better Selenium Tests with Geb - Selenium Conf 2014
Better Selenium Tests with Geb - Selenium Conf 2014Better Selenium Tests with Geb - Selenium Conf 2014
Better Selenium Tests with Geb - Selenium Conf 2014Naresha K
 

Viewers also liked (6)

Cloud browser testing with Gradle and Geb
Cloud browser testing with Gradle and GebCloud browser testing with Gradle and Geb
Cloud browser testing with Gradle and Geb
 
Java beyond Java - from the language to platform
Java beyond Java - from the language to platformJava beyond Java - from the language to platform
Java beyond Java - from the language to platform
 
Design Patterns from 10K feet
Design Patterns from 10K feetDesign Patterns from 10K feet
Design Patterns from 10K feet
 
Better Selenium Tests with Geb - Selenium Conf 2014
Better Selenium Tests with Geb - Selenium Conf 2014Better Selenium Tests with Geb - Selenium Conf 2014
Better Selenium Tests with Geb - Selenium Conf 2014
 
What makes Geb groovy?
What makes Geb groovy?What makes Geb groovy?
What makes Geb groovy?
 
Bike To Work Presentation
Bike To Work PresentationBike To Work Presentation
Bike To Work Presentation
 

Similar to Geb presentation

Agile NCR 2013 - Gaurav Bansal- web_automation
Agile NCR 2013 - Gaurav Bansal- web_automationAgile NCR 2013 - Gaurav Bansal- web_automation
Agile NCR 2013 - Gaurav Bansal- web_automationAgileNCR2013
 
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect ModelComprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect ModelvodQA
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!David Gibbons
 
BlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorksBlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorksmwbrooks
 
Single Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle StorySingle Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle StoryKon Soulianidis
 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBob Paulin
 
Mobile App Development: Primi passi con NativeScript e Angular 2
Mobile App Development: Primi passi con NativeScript e Angular 2Mobile App Development: Primi passi con NativeScript e Angular 2
Mobile App Development: Primi passi con NativeScript e Angular 2Filippo Matteo Riggio
 
Grails Plugins(Console, DB Migration, Asset Pipeline and Remote pagination)
Grails Plugins(Console, DB Migration, Asset Pipeline and Remote pagination)Grails Plugins(Console, DB Migration, Asset Pipeline and Remote pagination)
Grails Plugins(Console, DB Migration, Asset Pipeline and Remote pagination)NexThoughts Technologies
 
Writing automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjectsWriting automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjectsLeticia Rss
 
Google App Engine with Gaelyk
Google App Engine with GaelykGoogle App Engine with Gaelyk
Google App Engine with GaelykChoong Ping Teo
 
Pragmatic Browser Automation with Geb - GIDS 2015
Pragmatic Browser Automation with Geb - GIDS 2015Pragmatic Browser Automation with Geb - GIDS 2015
Pragmatic Browser Automation with Geb - GIDS 2015Naresha K
 
Modular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSModular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSGunnar Hillert
 

Similar to Geb presentation (20)

End-to-end testing with geb
End-to-end testing with gebEnd-to-end testing with geb
End-to-end testing with geb
 
Agile NCR 2013 - Gaurav Bansal- web_automation
Agile NCR 2013 - Gaurav Bansal- web_automationAgile NCR 2013 - Gaurav Bansal- web_automation
Agile NCR 2013 - Gaurav Bansal- web_automation
 
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect ModelComprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
 
Django at the Disco
Django at the DiscoDjango at the Disco
Django at the Disco
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
 
BlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorksBlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorks
 
Single Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle StorySingle Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle Story
 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache Sling
 
Mobile App Development: Primi passi con NativeScript e Angular 2
Mobile App Development: Primi passi con NativeScript e Angular 2Mobile App Development: Primi passi con NativeScript e Angular 2
Mobile App Development: Primi passi con NativeScript e Angular 2
 
Play!ng with scala
Play!ng with scalaPlay!ng with scala
Play!ng with scala
 
Grails Plugins(Console, DB Migration, Asset Pipeline and Remote pagination)
Grails Plugins(Console, DB Migration, Asset Pipeline and Remote pagination)Grails Plugins(Console, DB Migration, Asset Pipeline and Remote pagination)
Grails Plugins(Console, DB Migration, Asset Pipeline and Remote pagination)
 
Django at the Disco
Django at the DiscoDjango at the Disco
Django at the Disco
 
Django at the Disco
Django at the DiscoDjango at the Disco
Django at the Disco
 
Django at the Disco
Django at the DiscoDjango at the Disco
Django at the Disco
 
Django at the Disco
Django at the DiscoDjango at the Disco
Django at the Disco
 
WebGUI Developers Workshop
WebGUI Developers WorkshopWebGUI Developers Workshop
WebGUI Developers Workshop
 
Writing automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjectsWriting automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjects
 
Google App Engine with Gaelyk
Google App Engine with GaelykGoogle App Engine with Gaelyk
Google App Engine with Gaelyk
 
Pragmatic Browser Automation with Geb - GIDS 2015
Pragmatic Browser Automation with Geb - GIDS 2015Pragmatic Browser Automation with Geb - GIDS 2015
Pragmatic Browser Automation with Geb - GIDS 2015
 
Modular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSModular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJS
 

Recently uploaded

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 

Recently uploaded (20)

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 

Geb presentation

  • 1. Geb very groovy browser automation http://www.gebish.org 1 / 19
  • 2. Agenda 1. Introduction to Geb WebDriver Test framework integrations Navigation API Page objects Module objects Content DSL Multiple Environments 2. Our project-setup 2 / 19
  • 3. Introduction Automating the interaction between web browsers and web content Acceptance Testing Web Applications Screen scraping Great documentation: http://www.gebish.org/manual/current/ 3 / 19
  • 4. Example geb.Browser Browser.drive { go "http://myapp.com/login" $("h1").text() == "Please Login" $("form.login"). { username = "admin" password = "password" login().click() } $("h1").text() == "Admin Section" } 4 / 19
  • 5. Technology WebDriver (support many browsers) Groovy (remove java-boilerplate) Spock, JUnit or TestNG (easy to integrate with IDE and build systems) Navigator API (jQuery-like content selection) 5 / 19
  • 6. WebDriver Geb builds on the WebDriver browser automation librar Geb can work with any browser that WebDriver can Geb provides an abstraction layer, but you can access WebDriver directly Geb never talks to the actual browser. You need specific driver for each browser you want to work with: < > < >org.seleniumhq.selenium</ > < >selenium-firefox-driver</ > < >2.20.0</ > </ > 6 / 19
  • 7. Test framework integration Geb works with existing popular tools like Spock, JUnit, TestNG and Cucumber. You pick what you like; but Geb encurages Spock. 7 / 19
  • 8. Spock example geb.spock.GebSpec { "first result for wikipedia search should be wikipedia"() { given: to GoogleHomePage expect: at GoogleHomePage when: search.field.value("wikipedia") then: waitFor { at GoogleResultsPage } } } More about Spock @ https://code.google.com/p/spock/ 8 / 19
  • 9. Navigator API Inspired by jQuery. Content is selected via the $ function, which returns a Navigator object Makes it super easy to select content // match all 'div' elements on the page $("div") // match the first 'div' element on the page $("div", 0) // match all 'div' elements with a title attribute value of 'section' $("div", title: "section") // The parent of the first paragraph $("p", 0).parent() //<div>foo</div> $("div", text: "foo") // Using patterns $("p", text: ~/p./).size() == 2 $("p", text: startsWith("p")).size() == 2 http://www.gebish.org/manual/current/intro.html#the_jquery_ish_navigator_api 9 / 19
  • 10. Page Objects Less fragile code with better abstractions and modelling Promotes resuse Makes it easier to write tests Pages (and modules) can be arranged in inheritance hierarchies. Within your web app’s UI there are areas that your tests interact with. A Page Object simply models these as objects within the test code. This reduces the amount of duplicated code and means that if the UI changes, the fix need only be applied in one place. (webdriver...) 10 / 19
  • 11. Page Objects: example { url = "/login" at = { title == "Login to our super page" } content = { loginButton(to: AdminPage) { $("input", type: "submit", name: "login") } } } { at = { assert $("h1").text() == "Admin Page" } } Browser.drive { to LoginPage loginButton.click() at AdminPage } to changes the browser’s page instance. click on login-button changes page to the "Admin page" at explicitly asserts that we are on the expected page 11 / 19
  • 12. Module Objects Reusable fragments that can be used across pages Useful for modelling things like UI widgets that are used across multiple pages We can define a Navigator context when including the module in a Page. Module will then only see "its own part" of the dom via the navigator api 12 / 19
  • 13. Module Objects: example { content = { button { $("input", type: "submit") } } } { content = { theModule { module ExampleModule } } } Browser.drive { to ExamplePage theModule.button.click() } 13 / 19
  • 14. Content DSL Content definitions can build upon each other. Content definitions are actually templates. { content = { results { $("li.g") } result { i -> results[i] } resultLink { i -> result(i).find("a.l", 0) } firstResultLink { resultLink(0) } } } Optional Content { content = { errorMsg(required: ) { $("p.errorMsg") } } } 14 / 19
  • 15. Dynamic content { content = { linkTotrigger {$("a"} awesomeContainer(required: ) { $("div.awesome") } } } Browser.drive { to DynamicPage linkTotrigger.click() waitFor { awesomeContainer } } By default, it will look for it every 100ms for 5s before giving up. 15 / 19
  • 16. Multiple Environments The Groovy ConfigSlurper mechanism has built in support for environment sensitive configuration system property to determine the environment to use remoteDriver = {..} driver = { FirefoxDriver() } baseUrl = "http://iad.finn.no:3002/" iadUrl = "http://dev.finn.no" environments { 'dev' { baseUrl = "http://dev.finn.no/talent/" iadUrl = "http://dev.finn.no" driver = remoteDriver } 'prod' { baseUrl = "http://www.finn.no/talent/" iadUrl = "http://www.finn.no" driver = remoteDriver } } 16 / 19
  • 17. Our project-setup Kjører tester lokalt mot lokal server Kan kjøre tester som en del av maven-bygget men valgt å ikke gjøre dette siden vi er avhengig av finndev-login-tjensten Sparker i gang en testkjøring mot dev straks en ny artifakt er deployet i dev. 17 / 19
  • 18. FINN.no :: Testreports JUnit-listner that intgrates Geb with http://testreports.finn.no Support @Tags annotation Gives status and screenshots for each test Easy setup with the maven-surfire-plugin < > < >org.apache.maven.plugins</ > < >maven-surefire-plugin</ > < >2.16</ > < > < > < >**/*Spec.*</ > </ > < > < >target/test-reports/geb</ > < >${artifactId}</ > </ > < > < > < >listener</ > < >no.finntech.test.report.runner.GebTestReportRunListener</ > </ > </ > 18 / 19
  • 19. Demo time 19 / 19