Starting up:
The first thing we obviously need to do is to install watir. So lets get into that:
Download and install ruby:
I really recommend you to use the 1.8.6 one click installer because this include some dependencies that otherwise you will need to handle manually latter on. So to save time and avoid some minor complications latter on let's use that one.
There is really not much to say about the ruby install, just launch the installer, fallow the instructions and you should be ready to go in a few minutes.
If you keep all the defaults in the ruby install you have gems ready to use. I will not get into to much detail about gems, just google it and you will find a lot of information about it. For now just thing of it as a way to install "libraries" to your ruby install.
Launch a command prompt window and type:
gem update --system
Note that if you are using Windows you might or not get an error at the end of the update this is just because Windows is missing some build tools, don't worry about it.
After that and without closing the command prompt type:
gem install watirWait a couple of minutes and you should be good to go.
Now lets make sure that everything is correctly installed.
In the same command prompt just type:
irb
This will launch the ruby interactive console we will be using this a lot, but for now just notice that you prompt changes to a ruby prompt. There type:
require 'watir'
If you get a "true" response means you are ready to start having fun, anything else ... you are ready to have even more fun!!!
You will need to check your installs again and look for any specific error you migth be getting.
Optionally you should install the Windows Internet Explorer Developer Toolbar
This doesn't really have to do anything with Watir but you will see is a very useful tool for the scripting tasks. we will be getting into that latter.
After you have installed you should be able to find it in the ">>" Icon next to to "Tools"
We will use this tool to get the attributes and properties of the different elements on the web pages to use it you just need to activate the inspector by clicking the "Select Element By Click" icon in the tool bar and then click on any part of the page.
You should see how as you move through the page the different elements are being highlighted by a blue box. If you click any the properties are listed in the Attributes part of the toolbar.
Notice that while the inspector is activated you can't work with the element on the page, click on a button will display its properties not active the action, you can't type in to text box, etc, to do that you need to deactivate the inspector.
And so that's it for this post.
We are good to start writting test and that's what we will be doing in the next wave.