In the corporate software world, Java is something of a lingua franca. I’d wager that most large companies that have large codebases have at least some of their code written in Java. In many enterprise organizations, it’s the go-to language. This also tends to the be case with large Selenium-based test projects in many firms.
Java has several advantages, particularly for large-scale projects, such as excellent packaging for importing and exporting portions of a codebase and mature well-developed tooling. But Java is also a verbose language, and establishing a new project in Java can be cumbersome, particularly for novice developers. Java can also be, frankly, not very fun to work with. My standard opinion about the Java programming language is as follows: I love my family. I love my cats. I don’t love Java.
In no particular order, here are some reasons you should consider using each of these languages instead of Java.
Ruby: Ruby is the sleeper hit of Selenium test automation. Not only is Ruby a flexible, concise language but there’s also good tools that have been built on top of Selenium specifically for browser test automation. Capybara is a test framework that is included with Ruby on Rails, the popular BDD framework Cucumber has a large Ruby following, and there’s the excellent Watir library, which pre-dates the Selenium WebDriver. Most of all, there is an excellent community that has developed around test automation using Ruby. This community is highly active and constantly improving approaches and collaborating to make tooling even better. I would highly recommend any team starting from scratch with a choice of language stack to look into Ruby.
Python: Python is a lovely language to write code in. Due to syntax, all Python code looks very similar. It’s also cross-platform, working effectively on Linux, Mac and Windows OSs. Test tooling in Python is straightforward to use with the low-overhead of the PyTest framework. Python also has great related libraries for handing HTTP requests called requests and parsing HTML/XML called Beautiful Soup which can be extremely helpful for test frameworks that need to include testing beyond browser test automation. Python is fantastic for scripting small one-off tasks but can also scale up to meet the the demands of larger projects such as enterprise test frameworks.
C#: In some ways, C# is the better Java. From a language standpoint, it has a similar feel to Java being mostly class object oriented but with less strictness over file conventions. C# is also a first-class member of the .NET ecosystem which can provide two major benefits on Windows OSs. The first major benefit is Visual Studio, Microsoft’s flagship IDE and one of the best developer environments around. Visual Studio seamlessly combines many developer tools together, from test runners to performance profilers to source control systems. The second benefit is that .NET on Windows can integrate well with other OS level tools such as COM interfaces for desktop applications or MS SQL Server for database integrations. If you are testing applications built primarily for Windows, C# can offer quite a bit of value.
Before you reach for Eclipse, think about the above options and what else you can use for your test automation project that suit your needs and desires.