Automated Unit Testing vs GUI Automation



  • Automated testing is any type of testing where you are using one piece of code / program to test another piece of code / program. This can be unit testing as described above, or it can be via a specific automation tool, such as TestComplete, QTP, Selenium, etc.Unit tests tend to be created and executed by the developer of the code in question, whereas GUI automation will more probably be carried out by a software QA specialist.

    With regard to this certain questions come to mind.

    1. Is it better to write automated unit tests using code or perform GUI Automation using Automated Test tools like QTP, Selenium?

    2. In a SDLC lifecycle, what is the effort involved in writing Automated Tests using code versus GUI automation using Automation Test Tools?

    3. Are their benefits of writing Automated unit tests using code and performing GUI Automation using Automation Test Tools?



  • The purpose of the unit tests and GUI automated tests are different. The unit tests (usually implement by developers) should verify vary input and output of one function that under the test. It may be implemented with help the mock system if required. The unit tests usually run fast and all such suite haven't take more than 1 sec. The GUI test are simulated the user behaviour (we often call them end to end tests) and may take much more time for the execution.

    1. I wouldn't recommend write the unit tests with help of GUI automation because you want run them fast, rerun every time , be very stable and not be affected from other objects like browsers.
    2. It is much easy to write the automated tests using some automation recording however usually it is much less stable than code that you will write by yourself using the appropriated API.
    3. I am not sure that I follow you here but again the unit tests preferable write in code w/o GUI, the system test usually should be written with help GUI automation environment like Selenium.


Suggested Topics

  • 3
  • 2
  • 2
  • 2
  • 2