This section will present other CasperJS usages apart from testing.
Web scripting means to run a script that will use web pages as a backend service.
Of course, scripting a web page is quite a brutal way to obtain a service. Using a REST API (or any API) would be much more elegant. But in some cases there is no API. CasperJS is able to simulate user interaction on our web pages in order to test them.
But obviously, we can use its abilities to simulate user interaction on any web page in order to automate a process. That is why CasperJS is a very efficient web scripting tool.
Let's say we want a script to tell us how many unread messages we have in our Gmail inbox. We could use a script like the following (