The first time I had interaction with computers, it was the graphic design that got me into this profession. Since early on I was curious about video games and how those visual elements were created and combined together to present a seamless story. When I started programming, testing felt very daunting to me. The reason perhaps is that this field has become complex and setting up tools to write even the simplest of tests is pretty complicated. All I wanted was to validate if the story (program) I created is seamless or not. i.e. A simple way to automate some actions that a human being would take; provided the program is being built for a human. However, it was far from simple.
There is only one requirement for this and that is a headless browser. A headless browser is basically just like a regular browser but it runs in the background so that your script can run on it without a GUI. I personally like PhantomJS.
PhantomJS is pretty easy to install, Download the file based on the operating system you have and then run the executable
As always I recommend npm for the installation.
Once done, you can test if the setup was successful by running the following
In this example, we’ll go to http://definedictionarymeaning.com/ and search for a term and then confirm if we have programmatically reached the search page.