What are the pros and cons of using Selenium for automated testing?

Karyn Roark's picture
Karyn Roark asked on April 2, 2014 - 8:12am | Replies (7).

We are looking at testing tools and Selenium was recommended. So we are trying to find out what the pros and cons of using Selenium are for automated testing from testers who have been using it.

2 Comments

What is the product to be tested?

I've actually seen this type of question a lot, because people see "open source" and think of it as a free solutoin.  After talking to a number of other software companies, the consenses is that Selenium can be powerful, but only if you're willing to spend lots of time/money building out a framework and customizing it to meet your need.  Based on all of those discussions, I wrote the following article which examines the true cost of using Selenium: Why Selenium Isn't Really Free

7 Answers

Sudhir Patil's picture

If you are automating testing for Web based applications, IMO Selenium-WebDriver is the best available option. Not because it is open source but it is widely used and well supported by the community.

There are obvious Prons, let me highlight some of the Cons like,

1. Demands higher technical competencies, I would say tool of choice for developers. QA team members need to learn programming.

2. Need to work with many and connect third party frameworks (TestNG, Firebug etc) right from object identification, reporting, integrations with other ALM solutions etc.

Having said that it is still the best option for automated tesing with structured and methodical approach.

Timothy Western's picture

Sudhir has done a good job highlighting some of the higher level concerns, and the skill needs on a team so I won't focus on that.   I'd instead like to suggest that Selenium should never be used as your only automated testing tool.

 

Selenium/Webdriver is a tool primarily useful for end-to-end style automation.  While I have seen a small few developers wrap a few tiny almost unit UI tests around it, I do not feel it gives you your best bang for the buck.  In fact if automation is a goal of your team you likely want to be very judicious and careful where you  apply selenium.  Building a framework around selenium, using page objects, and then maintaing the other parts of the framework, that over time will need revision as the application under test changes will consume a good bit of your test teams time.   

 

Because of this you may want to find very specific types of tests to apply through the front-end with Selenium.  This means your team will want to apply other frameworks and tools to more lower level tests.  If you take a look at this blog post about inverting the testing pyramix, you'll see the same recommendation (http://nunoborges.com/nunoblog/2011/2/23/inverting-the-testing-pyramid.html) that you want to spend a lot more time with unit and functional level tests, and then less so on api, and GUI.  

 

There are many reasons for this.  Unit and functional tests are much closer to the code and thus are easier to setup quickly and isolate for behavioral testing.  API Testing is also good, as it allows you to check out the under lying business logic in a smaller subset of integration tests.   The UI Tests can also bring some value, but I warn you, they are going to be slow, and slower over time.  I've seen suites that have had to be broken up to keep build times under thirty minutes or an hour.  This is not uncommon when a vast amount of UI testing is being applied.  

So because of this, you want to apply different test techniques at each level, and try to leverage the scale differences and speed you gain, so that your UI tests can do what they are best at, verifying the interface is working, and less on its functional aspects.

Karyn Roark's picture

I would like to thank all of you for your responses to my question.  Your feedback is very helpful and much appreciated.

Karyn Roark

Ashwani Sharma's picture

As far as i know that pros and cons are different frameworks.. but i also would like to read best anwere of this question.. thanks dear to ask this question.

David Christian's picture

Well, from my point of view, following are some of pros and cons of using Selenium for automated testing

Pros

  • Low Cost Tool
  • Browser Compatibility Testing
  • Choice of Language
  • Multiple Testing Frameworks
  • Easy to Integrate With Testing Ecosystem
  • Open for Enhancement
  • Test Driven Development
  • Useful for Comprehensive Testing

Cons

  • Problems While Testing
  • Issues with finding Locators
  • Limitation in Browser Support
  • Manual Scripts Not Allowed
  • Slow Performance
Avinash Chandrashekar's picture

Firstly selenium only work over browser, if your work involves any application not accessible from browser, selenium will be a challenge.

Probably if you can describe the nature of your project would be able to guide further

StickyMinds is a TechWell community.

Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.