What's the Point of Selenium? What's the Point of Selenium? selenium selenium

What's the Point of Selenium?


It allows you to write functional tests in your "unit" testing framework (the issue is the naming of the later).

When you are testing your application through the browser you are usually testing the system fully integrated. Consider you already have to test your changes before committing them (smoke tests), you don't want to test it manually over and over.

Something really nice, is that you can automate your smoke tests, and QA can augment those. Pretty effective, as it reduces duplication of efforts and gets the whole team closer.

Ps as any practice that you are using the first time it has a learning curve, so it usually takes longer the first times. I also suggest you look at the Page Object pattern, it helps on keeping the tests clean.

Update 1: Notice that the tests will also run javascript on the pages, which helps testing highly dynamic pages. Also note that you can run it with different browsers, so you can check cross-browser issues(at least on the functional side, as you still need to check the visual).

Also note that as the amount of pages covered by tests builds up, you can create tests with complete cycles of interactions quickly. Using the Page Object pattern they look like:

   LastPage aPage = somePage      .SomeAction()      .AnotherActionWithParams("somevalue")      //... other actions      .AnotherOneThatKeepsYouOnthePage();   // add some asserts using methods that give you info  // on LastPage (or that check the info is there).  // you can of course break the statements to add additional   // asserts on the multi-steps story.

It is important to understand that you go gradual about this. If it is an already built system, you add tests for features/changes you are working on. Adding more and more coverage along the way. Going manual instead, usually hides what you missed to test, so if you made a change that affects every single page and you will check a subset (as time doesn't allows), you know which ones you actually tested and QA can work from there (hopefully by adding even more tests).


This is a common thing that is said about unit testing in general. "I need to write twice as much code for testing?" The same principles apply here. The payoff is the ability to change your code and know that you aren't breaking anything.


Because you can repeat the SAME test over and over again.