Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying PhantomJS Cookbook
  • Table Of Contents Toc
PhantomJS Cookbook

PhantomJS Cookbook

By : Friesel
4.2 (5)
close
close
PhantomJS Cookbook

PhantomJS Cookbook

4.2 (5)
By: Friesel

Overview of this book

A task-based guide that provides solutions to real-world test automation problems. This book is intended for web development professionals who want to integrate PhantomJS into their development and testing workflows. If you are a web developer looking to run automated unit tests while you work, or perhaps you are a QA engineer looking for a fast test automation utility, then this book is perfect for you. Some prior knowledge of JavaScript would be helpful.
Table of Contents (10 chapters)
close
close
9
Index

Installing CasperJS


In this recipe, we introduce CasperJS—a scripting and testing utility that targets PhantomJS—and demonstrate how to install it. We can think of CasperJS as a domain-specific language (DSL) that simplifies the code that we write to target PhantomJS; in particular, it makes it easier to reason about the asynchronous nature of PhantomJS.

Getting ready

Before we can install CasperJS, we need Python 2.6 or greater installed and on our PATH. Windows users will need the .NET Framework 3.5 or greater (or Mono 2.10.8 or greater) installed.

We will need Node.js and npm installed and on our PATH; we will also need an Internet connection.

Note

CasperJS requires PhantomJS version 1.8.2 or greater; however, as this book assumes that we are running version 1.9 or greater of PhantomJS, this should be fine.

How to do it…

The easiest way to install CasperJS is to use the Node.js package manager, npm. Enter the following at the command line:

npm install -g casperjs

We should see the console output...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
PhantomJS Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon