SlideShare a Scribd company logo
CasperJS
Howard 2013/12/22
CasperJS

CasperJS is an open source navigation scripting & testing
utility written in Javascript for the PhantomJS WebKit
headless browser and SlimerJS (Gecko).
It eases the process of defining a full navigation scenario
and provides useful high-level functions, methods &
syntactic sugar
Doing common tasks
 such as:
 defining & ordering browsing navigation steps
 filling & submitting forms

 clicking & following links
 capturing screenshots of a page (or part of it)
 testing remote DOM
 logging events
 downloading resources, including binary ones
 writing functional test suites, saving results as JUnit XML
 scraping Web contents
Installation

 Prerequisites
 PhantomJS
 PhantomJS is a headless WebKit scriptable with a JavaScript API.
 It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and
SVG.
 http://phantomjs.org/download.html

 CasperJS
目標

 列舉出目前 IPTECH TW
的目前可檢索的站台
A minimal scraping script
 What did we just do?
 we created a new Casper instance

 we started it and opened http://casperjs.org/
 once the page has been loaded, we asked to print
the title of that webpage (the content of its <title>
tag)
 then we opened another url, http://phantomjs.org/

 once the new page has been loaded, we asked to
print its title too
 we executed the whole process
start(), then(), run(), exit()


start()
 Signature: start(String url [, Function then])
 Configures and starts Casper, then open the provided url and optionally adds the step provided by the then argument



then()
 Signature: then(Function then)



run()
 Signature: run(fn onComplete[, int time])
 Runs the whole suite of steps and optionally executes a callback when they’ve all been done. Obviously, calling this method is
mandatory in order to run the Casper navigation suite.



exit()
 Signature: exit([int status])
 Exits PhantomJS with an optional exit status code.



Note that the current Casper instance automatically binds the this keyword for you within step functions
start(), then(), run(), exit()
start(), then(), run(), exit()

?
casper module – fill
 Signature: fill(String selector, Object values[, Boolean submit])
 Fills the fields of a form with given values and optionally submits it.
 Fields are referenced by their name attribute.
click
 click(Number x, Number y)
 click(String selector)
 Performs a click on the first element found matching the provided selector expression or
at given coordinates if two numbers are passed

 selector expression
 CSS3 selector strings
 Xpath expressions
evaluate
 Signature: evaluate(Function fn[, arg1[, arg2[, …]]])
 Evaluates an expression in the current page DOM context
Understanding evaluate()
 Think of the evaluate() method as a gate between the CasperJS environment and the
one of the page you have opened;
 Every time you pass a closure to evaluate(), you’re entering the page and execute code
as if you were using the browser console.
waitForSelector
 Signature: waitForSelector(String selector[, Function then, Function onTimeout, Number
timeout])
 Waits until an element matching the provided selector expression exists in remote DOM to
process any next step
references
 http://docs.casperjs.org/en/latest/quickstart.html
 http://docs.casperjs.org/en/latest/modules/index.html
 http://docs.casperjs.org/en/latest/modules/casper.html#start
 http://docs.casperjs.org/en/latest/modules/casper.html#then
 http://docs.casperjs.org/en/latest/modules/casper.html#run
 http://docs.casperjs.org/en/latest/modules/casper.html#exit

 http://docs.casperjs.org/en/latest/modules/casper.html#fill
 http://docs.casperjs.org/en/latest/selectors.html
 http://docs.casperjs.org/en/latest/modules/mouse.html#click

More Related Content

What's hot (20)

Игорь Фесенко "Web Apps Performance & JavaScript Compilers"
Игорь Фесенко "Web Apps Performance & JavaScript Compilers"Игорь Фесенко "Web Apps Performance & JavaScript Compilers"
Игорь Фесенко "Web Apps Performance & JavaScript Compilers"
Fwdays
 
Continuous Integration for front-end JavaScript
Continuous Integration for front-end JavaScriptContinuous Integration for front-end JavaScript
Continuous Integration for front-end JavaScript
Lars Thorup
 
System webpack-jspm
System webpack-jspmSystem webpack-jspm
System webpack-jspm
Jesse Warden
 
Javascript Test Automation Workshop (21.08.2014)
Javascript Test Automation Workshop (21.08.2014)Javascript Test Automation Workshop (21.08.2014)
Javascript Test Automation Workshop (21.08.2014)
Deutsche Post
 
ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!
Chang W. Doh
 
Роман Лютиков "Web Apps Performance & JavaScript Compilers"
Роман Лютиков "Web Apps Performance & JavaScript Compilers"Роман Лютиков "Web Apps Performance & JavaScript Compilers"
Роман Лютиков "Web Apps Performance & JavaScript Compilers"
Fwdays
 
Running JavaScript Efficiently in a Java World
Running JavaScript Efficiently in a Java WorldRunning JavaScript Efficiently in a Java World
Running JavaScript Efficiently in a Java World
irbull
 
NodeJS: n00b no more
NodeJS: n00b no moreNodeJS: n00b no more
NodeJS: n00b no more
Ben Peachey
 
Vagrant plugin development intro
Vagrant plugin development introVagrant plugin development intro
Vagrant plugin development intro
Budh Ram Gurung
 
Node ppt
Node pptNode ppt
Node ppt
Tamil Selvan R S
 
Module, AMD, RequireJS
Module, AMD, RequireJSModule, AMD, RequireJS
Module, AMD, RequireJS
偉格 高
 
Nodejs Intro Part One
Nodejs Intro Part OneNodejs Intro Part One
Nodejs Intro Part One
Budh Ram Gurung
 
Nodejs Intro - Part2 Introduction to Web Applications
Nodejs Intro - Part2 Introduction to Web ApplicationsNodejs Intro - Part2 Introduction to Web Applications
Nodejs Intro - Part2 Introduction to Web Applications
Budh Ram Gurung
 
Javascript asynchronous
Javascript asynchronousJavascript asynchronous
Javascript asynchronous
kang taehun
 
ECMAScript 6 and the Node Driver
ECMAScript 6 and the Node DriverECMAScript 6 and the Node Driver
ECMAScript 6 and the Node Driver
MongoDB
 
Node4J: Running Node.js in a JavaWorld
Node4J: Running Node.js in a JavaWorldNode4J: Running Node.js in a JavaWorld
Node4J: Running Node.js in a JavaWorld
Ian Bull
 
Like a Genie from a Lamp: Headless JavaScript Unit Testing with Jasmine and P...
Like a Genie from a Lamp: Headless JavaScript Unit Testing with Jasmine and P...Like a Genie from a Lamp: Headless JavaScript Unit Testing with Jasmine and P...
Like a Genie from a Lamp: Headless JavaScript Unit Testing with Jasmine and P...
Rob Friesel
 
Zombiejs
ZombiejsZombiejs
Zombiejs
Виктор Ткаченко
 
Nodejs intro
Nodejs introNodejs intro
Nodejs intro
Ndjido Ardo BAR
 
Ansible 202 - sysarmy
Ansible 202 - sysarmyAnsible 202 - sysarmy
Ansible 202 - sysarmy
Sebastian Montini
 
Игорь Фесенко "Web Apps Performance & JavaScript Compilers"
Игорь Фесенко "Web Apps Performance & JavaScript Compilers"Игорь Фесенко "Web Apps Performance & JavaScript Compilers"
Игорь Фесенко "Web Apps Performance & JavaScript Compilers"
Fwdays
 
Continuous Integration for front-end JavaScript
Continuous Integration for front-end JavaScriptContinuous Integration for front-end JavaScript
Continuous Integration for front-end JavaScript
Lars Thorup
 
System webpack-jspm
System webpack-jspmSystem webpack-jspm
System webpack-jspm
Jesse Warden
 
Javascript Test Automation Workshop (21.08.2014)
Javascript Test Automation Workshop (21.08.2014)Javascript Test Automation Workshop (21.08.2014)
Javascript Test Automation Workshop (21.08.2014)
Deutsche Post
 
ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!
Chang W. Doh
 
Роман Лютиков "Web Apps Performance & JavaScript Compilers"
Роман Лютиков "Web Apps Performance & JavaScript Compilers"Роман Лютиков "Web Apps Performance & JavaScript Compilers"
Роман Лютиков "Web Apps Performance & JavaScript Compilers"
Fwdays
 
Running JavaScript Efficiently in a Java World
Running JavaScript Efficiently in a Java WorldRunning JavaScript Efficiently in a Java World
Running JavaScript Efficiently in a Java World
irbull
 
NodeJS: n00b no more
NodeJS: n00b no moreNodeJS: n00b no more
NodeJS: n00b no more
Ben Peachey
 
Vagrant plugin development intro
Vagrant plugin development introVagrant plugin development intro
Vagrant plugin development intro
Budh Ram Gurung
 
Module, AMD, RequireJS
Module, AMD, RequireJSModule, AMD, RequireJS
Module, AMD, RequireJS
偉格 高
 
Nodejs Intro - Part2 Introduction to Web Applications
Nodejs Intro - Part2 Introduction to Web ApplicationsNodejs Intro - Part2 Introduction to Web Applications
Nodejs Intro - Part2 Introduction to Web Applications
Budh Ram Gurung
 
Javascript asynchronous
Javascript asynchronousJavascript asynchronous
Javascript asynchronous
kang taehun
 
ECMAScript 6 and the Node Driver
ECMAScript 6 and the Node DriverECMAScript 6 and the Node Driver
ECMAScript 6 and the Node Driver
MongoDB
 
Node4J: Running Node.js in a JavaWorld
Node4J: Running Node.js in a JavaWorldNode4J: Running Node.js in a JavaWorld
Node4J: Running Node.js in a JavaWorld
Ian Bull
 
Like a Genie from a Lamp: Headless JavaScript Unit Testing with Jasmine and P...
Like a Genie from a Lamp: Headless JavaScript Unit Testing with Jasmine and P...Like a Genie from a Lamp: Headless JavaScript Unit Testing with Jasmine and P...
Like a Genie from a Lamp: Headless JavaScript Unit Testing with Jasmine and P...
Rob Friesel
 

Viewers also liked (7)

Acceptance Testing - Automatisierte Web App Tests mit CasperJS
Acceptance Testing - Automatisierte Web App Tests mit CasperJSAcceptance Testing - Automatisierte Web App Tests mit CasperJS
Acceptance Testing - Automatisierte Web App Tests mit CasperJS
Björn Wilmsmann
 
JAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & JasmineJAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & Jasmine
Anup Singh
 
Intro to testing Javascript with jasmine
Intro to testing Javascript with jasmineIntro to testing Javascript with jasmine
Intro to testing Javascript with jasmine
Timothy Oxley
 
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
Christopher Bartling
 
Advanced Jasmine - Front-End JavaScript Unit Testing
Advanced Jasmine - Front-End JavaScript Unit TestingAdvanced Jasmine - Front-End JavaScript Unit Testing
Advanced Jasmine - Front-End JavaScript Unit Testing
Lars Thorup
 
Symfony Best Practices
Symfony Best PracticesSymfony Best Practices
Symfony Best Practices
Baptiste Donaux
 
CasperJS
CasperJSCasperJS
CasperJS
Kévin Lion
 
Acceptance Testing - Automatisierte Web App Tests mit CasperJS
Acceptance Testing - Automatisierte Web App Tests mit CasperJSAcceptance Testing - Automatisierte Web App Tests mit CasperJS
Acceptance Testing - Automatisierte Web App Tests mit CasperJS
Björn Wilmsmann
 
JAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & JasmineJAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & Jasmine
Anup Singh
 
Intro to testing Javascript with jasmine
Intro to testing Javascript with jasmineIntro to testing Javascript with jasmine
Intro to testing Javascript with jasmine
Timothy Oxley
 
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
Christopher Bartling
 
Advanced Jasmine - Front-End JavaScript Unit Testing
Advanced Jasmine - Front-End JavaScript Unit TestingAdvanced Jasmine - Front-End JavaScript Unit Testing
Advanced Jasmine - Front-End JavaScript Unit Testing
Lars Thorup
 

Similar to CasperJS (20)

Casper js
Casper jsCasper js
Casper js
Ajay Dutta
 
Василевский Илья (Fun-box): "автоматизация браузера при помощи PhantomJS"
Василевский Илья (Fun-box): "автоматизация браузера при помощи PhantomJS"Василевский Илья (Fun-box): "автоматизация браузера при помощи PhantomJS"
Василевский Илья (Fun-box): "автоматизация браузера при помощи PhantomJS"
Provectus
 
Laurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus PresentationLaurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus Presentation
Ajax Experience 2009
 
Jackson beyond JSON: XML, CSV
Jackson beyond JSON: XML, CSVJackson beyond JSON: XML, CSV
Jackson beyond JSON: XML, CSV
Tatu Saloranta
 
iOS build that scales
iOS build that scalesiOS build that scales
iOS build that scales
Tobias Hutzler
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012
ghnash
 
JavaScript
JavaScriptJavaScript
JavaScript
Ivano Malavolta
 
Scala at Netflix
Scala at NetflixScala at Netflix
Scala at Netflix
Manish Pandit
 
KSQL - Stream Processing simplified!
KSQL - Stream Processing simplified!KSQL - Stream Processing simplified!
KSQL - Stream Processing simplified!
Guido Schmutz
 
JavaScript Web Development
JavaScript Web DevelopmentJavaScript Web Development
JavaScript Web Development
vito jeng
 
Ajax tutorial
Ajax tutorialAjax tutorial
Ajax tutorial
Kat Roque
 
JBossWS Project by Alessio Soldano
JBossWS Project by Alessio SoldanoJBossWS Project by Alessio Soldano
JBossWS Project by Alessio Soldano
Java User Group Roma
 
April 2010 - JBoss Web Services
April 2010 - JBoss Web ServicesApril 2010 - JBoss Web Services
April 2010 - JBoss Web Services
JBug Italy
 
Calabash-android
Calabash-androidCalabash-android
Calabash-android
Adnan8990
 
Event-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 Engine
Ricardo Silva
 
Introduction to Scalding and Monoids
Introduction to Scalding and MonoidsIntroduction to Scalding and Monoids
Introduction to Scalding and Monoids
Hugo Gävert
 
Full Stack Scala
Full Stack ScalaFull Stack Scala
Full Stack Scala
Ramnivas Laddad
 
Scalable Angular 2 Application Architecture
Scalable Angular 2 Application ArchitectureScalable Angular 2 Application Architecture
Scalable Angular 2 Application Architecture
FDConf
 
[2015/2016] JavaScript
[2015/2016] JavaScript[2015/2016] JavaScript
[2015/2016] JavaScript
Ivano Malavolta
 
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
Codemotion
 
Василевский Илья (Fun-box): "автоматизация браузера при помощи PhantomJS"
Василевский Илья (Fun-box): "автоматизация браузера при помощи PhantomJS"Василевский Илья (Fun-box): "автоматизация браузера при помощи PhantomJS"
Василевский Илья (Fun-box): "автоматизация браузера при помощи PhantomJS"
Provectus
 
Laurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus PresentationLaurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus Presentation
Ajax Experience 2009
 
Jackson beyond JSON: XML, CSV
Jackson beyond JSON: XML, CSVJackson beyond JSON: XML, CSV
Jackson beyond JSON: XML, CSV
Tatu Saloranta
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012
ghnash
 
KSQL - Stream Processing simplified!
KSQL - Stream Processing simplified!KSQL - Stream Processing simplified!
KSQL - Stream Processing simplified!
Guido Schmutz
 
JavaScript Web Development
JavaScript Web DevelopmentJavaScript Web Development
JavaScript Web Development
vito jeng
 
Ajax tutorial
Ajax tutorialAjax tutorial
Ajax tutorial
Kat Roque
 
JBossWS Project by Alessio Soldano
JBossWS Project by Alessio SoldanoJBossWS Project by Alessio Soldano
JBossWS Project by Alessio Soldano
Java User Group Roma
 
April 2010 - JBoss Web Services
April 2010 - JBoss Web ServicesApril 2010 - JBoss Web Services
April 2010 - JBoss Web Services
JBug Italy
 
Calabash-android
Calabash-androidCalabash-android
Calabash-android
Adnan8990
 
Event-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 Engine
Ricardo Silva
 
Introduction to Scalding and Monoids
Introduction to Scalding and MonoidsIntroduction to Scalding and Monoids
Introduction to Scalding and Monoids
Hugo Gävert
 
Scalable Angular 2 Application Architecture
Scalable Angular 2 Application ArchitectureScalable Angular 2 Application Architecture
Scalable Angular 2 Application Architecture
FDConf
 
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
Codemotion
 

More from LearningTech (20)

vim
vimvim
vim
LearningTech
 
PostCss
PostCssPostCss
PostCss
LearningTech
 
ReactJs
ReactJsReactJs
ReactJs
LearningTech
 
Docker
DockerDocker
Docker
LearningTech
 
Semantic ui
Semantic uiSemantic ui
Semantic ui
LearningTech
 
node.js errors
node.js errorsnode.js errors
node.js errors
LearningTech
 
Process control nodejs
Process control nodejsProcess control nodejs
Process control nodejs
LearningTech
 
Expression tree
Expression treeExpression tree
Expression tree
LearningTech
 
SQL 效能調校
SQL 效能調校SQL 效能調校
SQL 效能調校
LearningTech
 
flexbox report
flexbox reportflexbox report
flexbox report
LearningTech
 
Vic weekly learning_20160504
Vic weekly learning_20160504Vic weekly learning_20160504
Vic weekly learning_20160504
LearningTech
 
Reflection &amp; activator
Reflection &amp; activatorReflection &amp; activator
Reflection &amp; activator
LearningTech
 
Peggy markdown
Peggy markdownPeggy markdown
Peggy markdown
LearningTech
 
Node child process
Node child processNode child process
Node child process
LearningTech
 
20160415ken.lee
20160415ken.lee20160415ken.lee
20160415ken.lee
LearningTech
 
Peggy elasticsearch應用
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用
LearningTech
 
Expression tree
Expression treeExpression tree
Expression tree
LearningTech
 
Vic weekly learning_20160325
Vic weekly learning_20160325Vic weekly learning_20160325
Vic weekly learning_20160325
LearningTech
 
D3js learning tips
D3js learning tipsD3js learning tips
D3js learning tips
LearningTech
 
git command
git commandgit command
git command
LearningTech
 

CasperJS

  • 2. CasperJS CasperJS is an open source navigation scripting & testing utility written in Javascript for the PhantomJS WebKit headless browser and SlimerJS (Gecko). It eases the process of defining a full navigation scenario and provides useful high-level functions, methods & syntactic sugar
  • 3. Doing common tasks  such as:  defining & ordering browsing navigation steps  filling & submitting forms  clicking & following links  capturing screenshots of a page (or part of it)  testing remote DOM  logging events  downloading resources, including binary ones  writing functional test suites, saving results as JUnit XML  scraping Web contents
  • 4. Installation  Prerequisites  PhantomJS  PhantomJS is a headless WebKit scriptable with a JavaScript API.  It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.  http://phantomjs.org/download.html  CasperJS
  • 5. 目標  列舉出目前 IPTECH TW 的目前可檢索的站台
  • 6. A minimal scraping script  What did we just do?  we created a new Casper instance  we started it and opened http://casperjs.org/  once the page has been loaded, we asked to print the title of that webpage (the content of its <title> tag)  then we opened another url, http://phantomjs.org/  once the new page has been loaded, we asked to print its title too  we executed the whole process
  • 7. start(), then(), run(), exit()  start()  Signature: start(String url [, Function then])  Configures and starts Casper, then open the provided url and optionally adds the step provided by the then argument  then()  Signature: then(Function then)  run()  Signature: run(fn onComplete[, int time])  Runs the whole suite of steps and optionally executes a callback when they’ve all been done. Obviously, calling this method is mandatory in order to run the Casper navigation suite.  exit()  Signature: exit([int status])  Exits PhantomJS with an optional exit status code.  Note that the current Casper instance automatically binds the this keyword for you within step functions
  • 10. casper module – fill  Signature: fill(String selector, Object values[, Boolean submit])  Fills the fields of a form with given values and optionally submits it.  Fields are referenced by their name attribute.
  • 11. click  click(Number x, Number y)  click(String selector)  Performs a click on the first element found matching the provided selector expression or at given coordinates if two numbers are passed  selector expression  CSS3 selector strings  Xpath expressions
  • 12. evaluate  Signature: evaluate(Function fn[, arg1[, arg2[, …]]])  Evaluates an expression in the current page DOM context
  • 13. Understanding evaluate()  Think of the evaluate() method as a gate between the CasperJS environment and the one of the page you have opened;  Every time you pass a closure to evaluate(), you’re entering the page and execute code as if you were using the browser console.
  • 14. waitForSelector  Signature: waitForSelector(String selector[, Function then, Function onTimeout, Number timeout])  Waits until an element matching the provided selector expression exists in remote DOM to process any next step
  • 15. references  http://docs.casperjs.org/en/latest/quickstart.html  http://docs.casperjs.org/en/latest/modules/index.html  http://docs.casperjs.org/en/latest/modules/casper.html#start  http://docs.casperjs.org/en/latest/modules/casper.html#then  http://docs.casperjs.org/en/latest/modules/casper.html#run  http://docs.casperjs.org/en/latest/modules/casper.html#exit  http://docs.casperjs.org/en/latest/modules/casper.html#fill  http://docs.casperjs.org/en/latest/selectors.html  http://docs.casperjs.org/en/latest/modules/mouse.html#click