How to choose which framework to use for automation that is based on Selenium

How to choose which framework to use for automation that is based on Selenium

The process of CI/CD requires testing the functionalities on daily basis, of course this is impossible to achieve with manual testing and limited number QA engineers. For that reason QA engineers are automating the scenarios in order to speed up the testing process. In this article I’m going to be focused on the frameworks for testing web applications, and how to choose the most suitable framework for your project.

Choosing the language

Let’s assume that we would have to automate website that has modern design, animations, etc. In this case it is preferred to choose the programming language that you are most comfortable to use. This will allow you setup the project structure in time, and start writing the tests without losing time learning new language.

The test runners

What’s the point of having tests if you cannot run them? In this section I’m going to cover frameworks that are based on Java, C#, Javascript / Typescript.

Java test runners

The most common used test runners for Java are JUnit and TestNG. The style of the automation with this runners are similar to the Unit tests written by the developers, and they are more technical. Meaning they are hard to read and understand by the non technical team members.

In cases when you have to have the automation scenarios to be read by non technical members it is good approach to use Cucumber. This is going to allow you to write the tests in readable format, and also re-use the steps of the scenarios, among other scenarios.

C# test runners

When automating the tests in C# I prefer nUnit / xUnit or SpecRun, and the reason for this is that you can have tests with technical style of writing, or having tests that are more readable. SpecRun is in combination with the Specflow framework, and this combination is preferred to be used when you need to have scenarios that are readable and understandable by the non technical members.

Javascript / Typescript test runners

If you prefer Javascript / Typescript for automation your scenarios, then Protractor is the tool you need. As explained above in Protractor you can also choose to write the automation tests in more technical, or business oriented way. When you do not need the automation tests to be written in a readable format for non-technical team members you can choose Jasmine. Jasmine with Protractor has the same result as Java with TestNG or C# with TestNG. In cases when you need the non-technical team members to understand the scenarios, you can combine Protractor with Cucumber to automate your scenarios.

Leave a Reply