Your SlideShare is downloading. ×
0
Introduction to

Console.log('Erol Seliektay');
What is
●

●
●

PhantomJS is a headless WebKit scriptable
with a JavaScript API.
Created by Ariya Hidayat. (http://ariya.o...
What Exactly Headless WebKit
●

●

WebKit is the layout engine that designed to
allow web browsers to render web pages.
Ch...
Use Cases
●

●

●

●

Headless web testing. Lightning-fast testing without the
browser. Various test frameworks such as Ja...
Features
●

●

●

●

Multiplatform, available on major operating
systems: Windows, Mac OS X, Linux, other
Unices.
Fast and...
Ecosystem
PhantomJS needs not be used only as a stand-alone tool.
Check also some excellent related projects:
●

●

●

●

...
How to Download and Set Up
●

Go http://phantomjs.org/download.html

●

Download phantomjs-x.x.x-windows.zip

●

Unzip the...
How to Run
●

Create a text file that contains the following
lines:
console.log('Radiohead is Awesome, by the way Hi World...
Examples
●

It captures screenshot with given width and
height also get the page title.
Examples
This script shows the number of twitter followers for a specific account.
Thanks
For more information visit:
●

https://github.com/ariya/phantomjs/wiki
Upcoming SlideShare
Loading in...5
×

Introduction to PhantomJS

6,287

Published on

Introduction to PhantomJS

Published in: Education
3 Comments
9 Likes
Statistics
Notes
No Downloads
Views
Total Views
6,287
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
69
Comments
3
Likes
9
Embeds 0
No embeds

No notes for slide

Transcript of "Introduction to PhantomJS"

  1. 1. Introduction to Console.log('Erol Seliektay');
  2. 2. What is ● ● ● PhantomJS is a headless WebKit scriptable with a JavaScript API. Created by Ariya Hidayat. (http://ariya.ofilabs.com) PhantomJS itself is NOT a test framework, it is only used to launch the tests via suitable test runner.
  3. 3. What Exactly Headless WebKit ● ● WebKit is the layout engine that designed to allow web browsers to render web pages. Chrome, Safari and a couple of other browsers also use WebKit. Actually, PhantomJS is a browser but a headless browser. This means that the rendered web pages are never displayed.
  4. 4. Use Cases ● ● ● ● Headless web testing. Lightning-fast testing without the browser. Various test frameworks such as Jasmine, Capybara, QUnit, Mocha, WebDriver, YUI Test, BusterJS, FuncUnit, Robot Framework, and many others are supported. Page automation. Access and manipulate web pages with the standard DOM API, or with usual libraries like jQuery. Screen capture. Programmatically capture web contents, including CSs, SVG and Canvas. Build server-side web graphics apps, from a screenshot service to a vector chart rasterizer. Network monitoring. Automate performance analysis, track page loading and export as standard HAR format.
  5. 5. Features ● ● ● ● Multiplatform, available on major operating systems: Windows, Mac OS X, Linux, other Unices. Fast and native implementation of web standards: DOM, CSS, JavaScript, Canvas, SVG. No emulation! Pure headless (no X11) on Linux, ideal for continuous integration systems. Also runs on Amazon EC2, Heroku, Iron.io. Easy to install.
  6. 6. Ecosystem PhantomJS needs not be used only as a stand-alone tool. Check also some excellent related projects: ● ● ● ● ● ● CasperJS enables easy navigation scripting and common highlevel testing. Poltergeist allows running Capybara tests headlessly. Guard::Jasmine automatically tests Jasmine specs on Rails when files are modified. GhostDriver complements Selenium tests with a PhantomJS WebDriver implementation. PhantomRobot runs Robot Framework acceptance tests in the background via PhantomJS. Mocha-PhantomJS run Mocha tests using PhantomJS.
  7. 7. How to Download and Set Up ● Go http://phantomjs.org/download.html ● Download phantomjs-x.x.x-windows.zip ● Unzip the folder ● Set the path: 1.From the Desktop, right click Computer and click Properties. 2. Click Advanced System Settings 3.Click Environment Variables... button 4.Select Path in System variables and click Edit button 5.Copy and Paste the location of phantomjs folder. Ex; in my case: “C:UserserolToolsphantomjs-1.9.2-windows” 6. Click OK buttons.
  8. 8. How to Run ● Create a text file that contains the following lines: console.log('Radiohead is Awesome, by the way Hi World!'); phantom.exit(); ● Save it as hi.js ● Run it from command prompt like this; phantomjs hi.js ● The output is: Radiohead is Awesome, by the way Hi World!
  9. 9. Examples ● It captures screenshot with given width and height also get the page title.
  10. 10. Examples This script shows the number of twitter followers for a specific account.
  11. 11. Thanks For more information visit: ● https://github.com/ariya/phantomjs/wiki
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×