I have created some testcases.

Where the test cases, test the functionalities are working fine and also test as the retrieved data are expected data that was displayed after you have clicked on the respective function.

Using those functionalities we go through the presentation, business and data layers.

After the test case completion, I was not sure, that i have used GUI tool, selenium tool or unit testing. I Don't have a clear picture between them.

My primary question is:

Should I go for a tool like selenium, unit testing or both and why?

These testcases are for critical functionality.


  • Could you tell us the structure of your team? How many developers and testers? Are you adopting a specific technology? Commented Dec 13, 2015 at 16:34
  • it is only me and one more. We are developers Commented Dec 13, 2015 at 20:05
  • Unit tests are usually 'headless' tests that don't use a browser. Selenium tests are GUI tests that are more associated with 'integration testing' and pretty much never used as Unit tests.
    – djangofan
    Commented Dec 23, 2015 at 0:28

3 Answers 3


Info: These testcases are critical functionality.

Judging by the above statement, I'd say you need to have both unit tests and UI automated tests (or integration as well depending on the architecture layer and systems integrated).
However, there are pros and cons on using both (that mostly depends on the organization, engineer in charge of creating one type or all of them).

For unit tests I'd go for pros with:

  • extremely fast to run
  • easy to create (taking for granted that the code is of high quality standards and unit testing "friendly")
  • better understanding of the code (by unit testing your code you may reveal cases you did not anticipate and will help you define the a better behavior of the code)
  • can catch high severity or show stopper bugs

As for cons, I'd go with:

  • increased overhead of amount of code to write. Having in mind that every class and method in your code will need to be tested, this can impact your ability as a developer to ship new features
  • one of the most important aspects, you cannot tests your UI (while you can unit test your JS for instance, it still doesn't assure you that you're on the safe side, especially for critical systems)

As for the UI tests, for Pros:

  • very good for validating user journeys and flows on the UI level
  • they can cover end-to-end flows that communicate with 3rd party systems
  • like unit tests, can catch high severity or show stopper bugs
  • may be able to check UI functionality where it is not always possible to test otherwise

As for cons:

  • UI tests can be very brittle (will fail due to UI changes even though functionality hasn't changed. E.g. identifiers like ID have been changed on your page)
  • the execution will be considerably slow compared to unit tests as you have to wait for the system to launch and for connections with 3rd party system that can take a long time
  • you will need to depend on a 3rd party tool (open source or paid)

In conclusion, I'd go with unit tests for the critical core functionality and UI tests that will also cover that critical functionality from the UI side (or end-user point of view).

  • 1
    amen. Just to add : when everything is perfect, unit tests are done by the programmers themselves. It's a first level of defence that prevents many mistakes from happening. I'm only doing GUI testing, and I shouldn't meet crashing components. Yet I do, because we unfortunately lack unit testing.
    – gazzz0x2z
    Commented Dec 14, 2015 at 10:43

Probably you're talking about some kind of smoke testing. Usually it's done as a system/integration testing. Unit testing is a responsibility of every developer not a QA engineer.

  • So if you're from testing team, the answer is using GUI tests for the whole software.

  • If you develop some critical components, writing good unit tests are highly desired for your component. Unit testing relates to calling small atomic pieces of the component (unit) under test: functions and methods of classes. So you need to know how every function works. And you definitely need to talk about system level test automation to your colleagues from QA team.

If you're a project manager or a team lead or all-in-one guy who get all job done, of course both directions are important. :)

  1. Unit Testing:


  1. GUI Testing: Ranorex GUI automation projects are easily integrated into existing development environments, thus allowing to extend continuous integration processes with Ranorex UI testing. Additionally, straightforward report generation helps to reduce debugging time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.