Selenium 1.0 Testing Tools Beginner's Guide - book review

This is a review of "Selenium 1.0 Testing Tools: Beginner's Guide" book by David Burns (Packt Pub, 2010).

The book introduces Selenium testing tool. It is aimed at complete beginners who wants to learn Selenium from the very beginning. The book consists of little bits of theory and a lot of examples. In fact, it follows a cookbook approach presenting small chunks of Selenium's functionality one by one.

What Is Inside?

The book starts with detailed instruction on installation of Selenium IDE (a Firefox record-and-playback tool). Then, after writing some very basic tests it moves (surprisingly) to advanced topics: handling of multiple windows and testing AJAX powered web applications. However, all examples (in all sections) are the simplest possible. Nothing more than one or two web pages and few form buttons. This makes them easy to follow, but I suspect that for real-life scenarios you will surely need to read a lot of documentation.

Next comes two chapters on locators and pattern matching. Useful, but definitely way too wordy.

I really enjoyed the chapter on Javascript use in Selenium tests. I learned there how to deal with variables (storing and reusing some values) and how to access the browser from within tests.

Now the book switches to writing Selenium tests with Java. First it explains the installation of Selenium RC, then shows how to write tests, including basic stuff like using setUp methods for server start etc.

Next chapter ("Advanced Techniques") was more interesting. It presents how to deal with cookies. I was also happy to learn that Selenium supports taking screenshots of the whole page (and not only of a visible part of it).

Then Selenium Grid is introduced. The book describes its installation and use. For me, who has never touched Selenium Grid before, it was interesting. The following chapter - on parallelization of tests - is based on the use of TestNG.

The last chapter is devoted to Selenium 2. It explains the difference and shows how to migrate your tests from Selenium 1.

230 Pages?

The book is ~230 pages long, but because of detailed descriptions of steps to be performed for each described feature of Selenium, there is not so much context that you could expect (on some many pages). At the same time, the table of contents seems to be complete.

Each action is described, also screenshots are frequent. At one hand this is really convenient, because it is really hard to get lost while following the examples from the book. On the other hand, some sections (i.e. "What just happened?") seemed repetitive and useless. Sometimes even screenshots of IDE actions are included (e.g. detailed information on how to perform "extract method" refactoring is accompanied by a picture showing this in action... eh... what for?!). It made me feel like author was being paid by the number of pages and added unnecessary stuff out of greed. :)

I was really surprised by the extent to which the authors treat their readers as beginners. I expected that the book is aimed at Selenium beginners. But during the reading, it seems to me that the book is rather aimed at general computer programming beginners, who wants to learn Selenium. If you feel like one, you will be delighted. If you have experience with programming, IDE and testing, you will find some parts of the book absolutely useless. And by the way, if you are an experienced Selenium user, you should not touch the book at all.

I think that sometimes more value could have been provided to the readers. For example, chapter on Locators gives few examples for each of locators types (ID, name, CSS etc.), each with a screenshot. Seems like a waste of space for me - a concise table with various XPath or CSS expressions would be much more useful (it could contain even more examples, and at the same time, eat 1/10th of space).

Also the Pattern Matching chapter is rather too long. Some of the features are rarely used, yet, description of each takes at least 1 page (screenshot included). How often do you write a test to check if your webpage contains ?ool phrase (so you find cool or pool)? This is only an example of not-really-useful feature, that definitely should be mentioned, but is unnecessarily elaborated over.

Really annoying repetitions. For example you have a 2 pages description on how to run tests with IE. It all boils down to this, that you should run a single line. Next, you have these 2 pages repeated with IE replaced with Chrome everywhere. Well, that is kind of strange. I would say simply: If you want to use Chrome follow the steps described in the previous chapter, but exchange *iexplorer with *googlechrome. The book would be 1/2 of its size then (which would be good!).
So, we have just wasted 2 pages and the next page is filled with list of supported browsers. Nice, but still lacking something. Some names are easily recognizeable (*konqueror, *opera) but what is *mock, piiexplorer, *safariproxy or *pifirefox?

Similarly it surprised me, that there are examples of writing Selenium tests with Java using three testing frameworks introduced - JUnit3, JUnit4 and TestNG. And, as described previously, you get the full, step-by-step description for each of them. Hm... this makes no sense to me. The book has no chance to introduce anyone to using a testing framework. If the reader does not know how to use them, she/he will have to learn them anyway by reading other documentation. In short - no real benefit for the user at all. They could have put one example (TestNG, as it is also used later with Selenium Grid) and put the rest in the source code downloadable with the book

Conclusions

I used Selenium some time ago, and wanted to refresh my memory. I read the book, and I have very ambiguous feelings. At one hands it gives what it promises, introducing beginners to Selenium. At the other hand, I felt rather like reading a tutorial, not a book. I do not like this "click here and here and here, and voila!" approach without giving enough context information.

...and all the time the feeling that all this could have been explained in 50 pages was overwhelming.

If you are completely new to Selenium, and you like step-by-step tutorials, you might find this book helpful. In other case, do not bother.

P.S. I'm not sure about this, but I guess that 100% of the information that is presented in the book could be easily found on the Internet. I can't see any value added by author, really.

Nitpicking

Some stuff that irritated me during the lecture of the book.

  • No word on competition, no comparison with other tools. Only a tutorial on how to use Selenium. Period.
  • The code is bad indented on some listings. It makes them hard to read. Annoying.
  • Selenium Castro - is it free? No word about its license.
  • Around one page of information on writing robust, maintainable tests is not much, is it?
  • Selenium Core mentioned few times but never really explained.
  • Not sure why bother with Selenium 1 if Selenium 2 is so close to being finished?

Links

Let's me try Selenium IDE

Many guys told me Selenium IDE is very useful, but I seldom use it. Maybe I need read this book: Selenium 1.0 Testing Tools: Beginner's Guide to learn how to start this great tools now.

- pain in left side

 
 
 
This used to be my blog. I moved to http://tomek.kaczanowscy.pl long time ago.

 
 
 

Please comment using