How to Select a Scripting Language for Selenium WebDriver Project

- May 29, 2014
- Kualitatem
“This post is a quick comparison between WebDriver Java and Python APIs”
The thing that makes Selenium WebDriver superior to other web automation tools is the wide range of language and framework options it provides to the users for writing test scripts. Selenium WebDriver supported languages include Java, Python, Ruby, C#, JavaScript, Perl and PHP. When it comes to the frameworks that can be used with WebDriver, there’s quite a long list. Some of the popular supported frameworks are JUnit, TestNG, RSpec, unitTest, PHPUnit, and FitNesse, etc. Selenium WebDriver is designed to provide a simpler, more concise programming interface to complement the limitations in the Selenium-RC API.
Its always good to have options and choices but sometimes making a choice from a long list of available options becomes a difficult thing to do. There are number of decisive factors that help us in making an appropriate scripting language choice while starting a new WebDriver automation project. Some of the important factors that normally affect our choice are listed below:
- Different frameworks and tools that can be used with different APIs
- Available documentation and support for different WebDriver APIs
- Maturity of APIs and frequency of updates to them
- List of supported browsers and project requirements for browsers
- Ease of setting up scripting or running environment
- Complexity level of web applications
- Use of technologies like Flash, Silverlight etc. in web applications
- Maintainability and Scalability requirements of the project
- Skill level and experience of QA resources in different programming languages
- In house support available for different languages from developers
- Test cases complexity and required test coverage
Recently, here at Kualitatem, we received a request for automating a web application that was developed in Python Django framework and had some modules developed in flash. Before starting the project, we did a short study on WebDriver Java and Python APIs and also analyzed other factors mentioned above to make a choice that suited best for this project. Findings of the study are summarized in the following table:
Comparing Factors | WebDriver Java | WebDriver Python |
Documentation & online support available | More documentation and online support available | Official documentation available but lesser online support |
Ability to handle complex scenarios | Java & Python API features are identical and both can handle complex scenarios | Java & Python API features are identical and both can handle complex scenarios |
Flash, Silverlight etc. handling | WebDriver can handle Flash and Silverlight when used with Sikuli (supported in java) | Cannot handle Flash and Silverlight (no documentation available) |
Supported frameworks (as per our requirements) | TestNG, JUnit, Sikuli | unitTest |
Supported browsers | Firefox, Chrome, IE, Opera, HTML unit, Android, iPhone | Firefox, Chrome, IE, Opera, HTML unit, Android, iPhone |
Setting up environment for running script | Little complex to setup | Easier to setup |
API matureness and updates frequency | Primary WebDriver API. All new features are first implemented here | Equally mature but lesser support and delayed updates |
In house support available from developers | Developers could support equally for Java & Python | Developers could support equally for Java & Python |
QA resource expertise | More experience of WebDriver Java projects | Few projects in WebDriver Python |
Learning curve for language and API | Higher | Lesser |
After considering all of the above factors, it was concluded that there is not much difference between Java and Python API apart from available online support and flash handling capabilities. We decided to go with WebDriver Java API as the application had some modules developed in flash, and in order to handle them we wanted to use Sikuli (which works in integration with WebDriver Java API). Apart from that, factors like better online support and QA resources experiences also made the case favorable for WebDriver Java API.
Any body who has worked on the Selenium WebDriver ? We would love to hear your experience. Feel free to share your thoughts and add any other decisive factors to this comparison!
Leave a Reply