| || |
Automate API or GUI testing?
I am new here on this forum so I would like to take a few seconds to introduce myself. My name is Ben and I have been working for 10 years in the testing field as a Test Consultant. In the last year of my career I am involved in a Scrum team as a tester developing an ERP-like application running on .NET with a SOA architecture. During my time in this environment we would love to implement automated testing for regression testing purposes. Due to the fact that I never was heavily involved with implementing test automation I am doubting which apporach we should use (API automation or GUI automation).
Like stated before, the involved application is a desktop application of which the GUI is developed in .NET and it involves services for communication between the client and the server. So in this case API and GUI automation are both possible options to implement. However I was curious which apporach is better? Like I stated before, we would like to use the automation solely to automate functional scenario's with regards to regression testing and nothing else. I also understand that automating from a API perspective, the maintenance is easier and provides more 'flexibility' instead of GUI automation (due to frequent changes to the GUI which requires 'heavy' maintenance'). Is a mix of API and GUI automation also a good practice to implement or is this discouraged to avoid complexity?
What is your opinion about this? Thanks in advance.
It is not a question of better. It is a question of appropriate. You have requirements. In order to validate whether the requirements have been met your test cases will need to validate some expected results. Based upon the nature of the validation you may wind up assessing state at GUI, at API, or perhaps both if a value requires validation of presentation in the GUI.
...However I was curious which apporach is better?...
Look to your requirements, both technical, user based and business. Build your test cases. Let the nature of the examination drive the layer of examination.
My recommendation is to Automate the API, it'll in theory change less than the UI.
For the UI automation, you'll want to have a few workflow tests to ensure proper integration between UI and API backends. The key here is focusing on making sure things are hooked up correctly, while you do the bulk of the business logic tests at the API level.
I will recommend to Automate API using tool like Selenium or SOAPUI (latest) as on GUI there would be less changes as compare to API.Therefore, it is always better to automate test cases which required to run often because there will be chances of defect leakage.
I would say Use both , Make sure you enough good scenarios covered in the API Testing. I will suggests Using POSTMAN or RestAssured(Java lib) to create test cases that matters the most like High Level/Important for API Testing. For other Part(GUI) you can automate the GUI by using the Python GUI library and other GUI automation tool like AUTOIT etc.