Does it matter that I am writing automation code in a different language to that used in development?

At the moment I am learning how to write code and furthermore automation tests using Selenium WebDriver and Java, so that I can start looking at automating some of the manual regression tests which are executed each iteration. The technology stack at our company is .net meaning that development is written in c# using Visual Studio.

Not that I can think of one, but I’m intrigued as to what peoples opinions are and whether this can create any issues in that I am writing automated tests in a different language to that where development is carried out. I’ve found that, in the main, a lot of the useful information found online(in my experience anyway!) relates to learning Selenium using the Java language and there isn’t as much out there for c#.

Whilst I can write code in c# it would also be useful to know if it’s a concern that in the long run I’ll be less proficient in this than Java?

Cheers

Andy

2 Likes

In terms of your own tests, I personally don’t see it as an issue.

The only downside might be if you were to need help from your Developers. They would probably be more able to help with Selenium in C# than Java.

I suppose it also depends on what you can get your hands on. I have Java here, but cannot ‘easily’ use C#. I cannot get hold of Visual Studio or even Visual Code with my locked down build. Like you, I started with C#. I moved into Java because that is what is available. Because of that, I have a usable knowledge of both.

7 Likes

Though not a decisive issue, there are advantages to using the same language and IDE as the developers.

You may want to consider MS Coded UI Test (CUIT), which uses C# and Selenium webdriver. It comes with Visual Studio Premium and Ultimate, which your shop may already be using.

I’ve written about some of my experiences with CUIT over at my blog.

2 Likes

You and the business are better off if you can use a language that is commonly employed by others there. It benefits you because you can use the patterns that others are using and get help from them. It also means that when you do pull requests / code reviews, people are well versed in the language and can give good feedback. It benefits the business because after you leave, what you’ve written can still be easily understood, maintained, and extended.

This doesn’t mean you have to use the language that the devs are using – it could be that you have peers in other positions (e.g., other testers) who are writing code, and you could agree on a common language with them.

3 Likes

No
But using a testing tool language that nobody else knows is not going to be useful either. However look at the case where writing tests in a low level language like C becomes inappropriate if the thing being tested is very high level thing like a REST interface for example.

Tests suites benefit from things script languages support inherently like late binding, and there are many specific languages that solve the test problem better than many compiled languages might do. But use the same language as the product if in doubt.

Your selenium e2e tests are testing the front end so the natural choice would be JavaScript if you’re thinking about aligning test code with the Dev team. There are loads of options, I’d recommend protractor but there’s also night watch and loads more.

Once again, thanks very much for your responses. Finding this a great forum to help clear up some of the issues I have had with this.

3 Likes