Selenium as an Automation Testing tool — Aye or Nay?9th May 2019
Selenium for Test Automation — Yay or Nay?
In this article, we’ll look at some of the aspects that led to the widespread adoption of Selenium as the de-facto standard for web automation. We’ll also check the scope for advancement and improvement in a Selenium-based test framework.
“Selenium automates browsers. That’s it! What you do with that power is entirely up to you. Primarily, it is for automating web applications for testing purposes but is certainly not limited to just that. Boring web-based administration tasks can (and should!) be automated as well.”
As SeleniumHQ states above, the primary use of Selenium has been to automate Web Applications for Testing purposes, and it has been doing the same for a decade or longer. From Selenium RC and Selenium IDE, it has grown to a full-blown Web Automation library that supports multiple browsers and Platforms.
Selenium has been around for a long time, and it is, without a doubt, a great tool. It has been serving Automation Testing needs of testers worldwide for quite a long time.
1. Open Source/ No Licensing costs
Selenium has no upfront licensing costs or payments to be made for its use since its freely available. It is also an open source project which allows for extension and modification of the base framework for one’s personal or professional usage.
3. Third-party Integrations
Selenium does not restrict a QA’s choice of reporting tools, build systems or any other aspect of their development/testing stack. It integrates well with popular tools such as SauceLabs, Selenium-Grid, Extent, JUnit, and others.
4. Parallel Testing
Selenium supports parallel test executions by integrating with Selenium Grid which helps to considerably bring down the feedback time for test executions.
5. Cross Browser and Platform-independent
Selenium supports all popular web browsers such as Google Chrome, Firefox, Safari, Opera, etc. and works on all currently available operating systems platforms such as Windows, Mac, and Linux.
6. Community Support
Selenium is backed by a vast community of developers and testers who actively contribute to the tool and documentation.
These reasons make Selenium a great choice for automation testers in enterprises around the world. However, as time flows and technology advances, we need to adapt and adopt newer tools and technologies to keep pace.
One of the advancements that we can’t ignore is the impact of Artificial Intelligence. AI is being heavily adopted in all of fields and software test automation is one such field that can gain from it. Modern test automation frameworks need to leverage their capabilities better.
Now, let’s look into some other reasons that urge us to look for a better alternative to Selenium.
1. High Initial Setup time and costs
It is true that Selenium is free and there are absolutely no licensing costs involved. However, when it comes to ROI and Initial Cost, we need to think about a couple of other factors.
- The setup and configuration of a Selenium-based test framework take considerable time. That adds up to indirect costs.
- For a team consisting of mostly manual testers, the members need to learn to programme or the company needs to hire a bunch of automation experts to automate using Selenium.
Proposed solution: Codeless test automation tools can help the manual testers step up to the automation game easily. Most of these tools come with zero initial setup time as well since they are hosted on the cloud.
2. Not an all-in-one solution — The requirement for 3rd party bindings
Selenium + TestNG/JUnit is not the complete, comprehensive solution to fully automate the testing of your web applications. You need different libraries(POI API, GSON, Extent Reports) to make it a complete solution for a testing framework. And managing multiple dependencies is difficult and extra maintenance work that everyone wants to avoid.
Proposed solution: A good dependency management tool such as Maven, Gradle or NPM can make this task easier. Ant is outdated now and I wouldn’t suggest it since there are better solutions.
3. The difficulty of managing local test infrastructure
Parallel testing is very much possible with Selenium Grid — however, it is not always feasible to set up and manage a local infrastructure (test machines) since the requirements for devices vary with projects.
Proposed solution: Using a cloud platform (IaaS) for the test environments would avoid the hassle.
4. Eventually becomes a parallel development solution
There’s a lot of complexity involved in bringing multiple things together to create an effective and highly functioning test automation ecosystem based on Selenium. It takes huge technical efforts and requires constant updates, improvements, and maintenance of the complete framework. Eventually, it becomes a parallel development project which small and medium-sized companies can not afford in the early stages.
Proposed solution: Use a ready-to-use solution that delegates the maintenance to an external team so that the QA can spend more time on actual issues or bugs.
5. Inability to integrate Continuous Testing/in-sprint automation
With its code-based approach and high dependence on the UI, it is difficult for Selenium-based projects to shift the testing more to the left, which is required for continuous testing.
Proposed solution: Frankly, I don’t have a solution for this issue with Selenium since the dependency on UI is a fundamental drawback and one of the ways to shift left would be to rely on API Tests from the beginning.
6. No participation from non-technical resources
In Continuous Delivery and DevOps, quality is everyone’s responsibility. But with the cryptic code-based approach, only programmers can participate in the test creation activities.
Proposed Solution: Use a framework or tool that provides highly readable tests (to be read as BDD or TDD) and encourages the collaboration of team members.
7. Lack of professional on-demand support for enterprise projects
Even though the Selenium community is pretty helpful, you can’t always rely on community support for large scale enterprise projects which demand utmost privacy and quick resolution time.
Proposed solution: Something similar to point 4.
8. Solving automation/maintenance challenges
There are no inbuilt solutions for specific tasks such as Flaky Tests due to dynamic UI, File handling, API Level tasks, OS-based popup handling, and Basic Authentication
Due to the heavy usage of AJAX and modern web development technologies, Test is not always very stable. Also, since the Test Scripts are code-based, Test Maintenance is a bit difficult.
9. Limited capabilities
Having no built-in test management, test data management, or test reporting capabilities.
Proposed Solution: Integrate with a third party test management tool and third-party libraries for test data management and test reporting.
These are some of the reasons that led us (our team at Testsigma) to think about a new tool which can address all of these challenges. And we believe we have been quite successful in delivering the same.
First seen at Pros and Cons of Selenium as an Automation Testing tool.
Selenium as an Automation Testing tool — Aye or Nay? was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.