Installing Watir (and Ruby and FreeRIDE and Commonwatir), 60 minutes of bliss
Posted by testcrunch on 4th November 2009
Someone wanted to know what open source, or just plain free, software existed for the testing of web pages, and it had to be simple to use. No coding.
I had another look at Selenium IDE and that works OK, if you can justify the time to generate working scripts, except it’s got the reputation from hell when using Internet Explorer. I got the plug-in working in Firefox but the client only uses IE so that’s the end of that.
I then had a look at Watir and that took a while to get going. Downloaded the latest Watir file and couldn’t get it to do anything, so started reading. Ah..it needs Ruby, as Watir is a Ruby Gem, whatever that is (A packaged Ruby application or library like Rails. Ed), so downloaded and installed Ruby, which sticks it’s folders at the end of your path so that commands can be run from a command window. It was supposed to come with an IDE called FreeRIDE but it wasn’t there so I downloaded that seperately and that installed OK. I then tried to install Watir with the command ‘gem install watir’ and that failed. More reading and I needed to generate some (all?) of the Ruby Gems. Did that with ‘gem update –system’ (Updates the Gem system. Ed). Checked that they had been generated OK and reran ‘gem install watir’ and again it failed with a message that ‘Commonwatir’ was missing. Installed Commonwatir, and Firewatir, and again tried to install the Watir Ruby Gem, and this time it worked, well it thrashed about a bit and displayed messages saying ‘Successfull’.
OK, so what do I do now? I found some Ruby code for checking a Google search and whether the resultant page contained specific text, in this case ‘Programming Ruby’. Copied the text into Notepad, amended it slightly, saved it with an extension .rb and loaded it into FreeRIDE, hit F5 to run the darn thing and it responded with a message that the text was found correctly. Amended the text to be searched for to some gibberish, saved the file and reloaded it into FreeRIDE and ran it again and as Google had searched for the nonsense I’d asked for, and which most definitely didn’t contain any text called ‘Programming Ruby’, Watir correctly displayed a message that the text was not found. Yikes the critter works.
Normall clunky installation that would have been sped up if I’d coughed up $50 for a Ruby/Watir bible but it does work. Trouble is the client wants software with no coding and Watir seems to be just coding.
Posted in Selenium - not toxic, Watir - record & playback? Nope | 1 Comment »
