3

Let me clarify a few things.

  1. I'm not talking about unit tests. I'm talking about integration tests. After the build is completed then we are testing the web application.
  2. I am not talking about browser automation. If you're accessing the browser to access the web application then you are doing UI automation. This is known to break frequently.
  3. I am not talking about headless testing in which we are still automating via the browser, but the browser's UI doesn't show up. That is not what I am talking about.

I'm talking about automating a web application without using a browser. Is that possible? I've read in various books/online articles where the author recommends automating without the UI first because it will be more stable than browser (aka UI) automation.

How can I implement functional, non-browser automation for my product?

Edit: I'm currently not in a position to find out whether or not our product has a WebAPI since I'm just starting out. Answers should include both the cases - if it's present as well as if it is not present.

  • 2
    @VishalAggarwal, please try to be a little more tactful in your request for more information. It could appear to be aggressive and angry to some readers. – Kate Paulk Jul 16 '18 at 11:46
  • Sure @Kate, it's learning for me. – Vishal Aggarwal Jul 16 '18 at 20:54
2

When a user interacts with your web application using web-browser, the browser just sends HTTP requests to the server and gets HTTP responses. Sometimes the apps use WebSockets as well.

So basically to automate testing without using a browser you can use any of the clients for mentioned protocols which I believe widely represented for any popular programming language.

| improve this answer | |
1

Your answer lies in a single concept, and that is Test Automation Pyramid. Below link explains that in detail.

https://martinfowler.com/bliki/TestPyramid.html

In short, a normal enterprise application consists of multiple layers like UI, API, DB etc. You also need to know what each layer is responsible for. When people talk about test automation, most of them assume that to UI automation. But there is another layer like API(REST) which is providing data to the UI and UI layer only paints that data. So it is really crucial to verify the API layer.

Now I believe what you need is API automation. If your APIs are correct then most of the business logic is already tested and you just need to verify only a sub-part of UI. There are a lot of API testing tools and libraries like soap-UI, RestAssured, python's Request library etc.

Hope your query is answered.

| improve this answer | |
  • Any idea how we can identify the layer that the UI layer gets the data from? What do we call it and how can I get started with automating that layer? – Mugen Jul 13 '18 at 10:36
  • 2
    The first point of contact for this would be the development team to understand the application architecture. If this option is not available or you want to explore, then you can use browser's network part in the dev tools and see what are the APIs involved. You can also use tools like Fiddler or charles which capture all inbound and outbound calls for any application. Explore that and when understand them, you can think of automating them. – Kshetra Mohan Prusty Jul 13 '18 at 11:37
  • Do you have any idea whether directly capturing all inbound/outbound calls for an application, making functions out of them and then re-running them is a good way to automate tests? I'm guessing that the parameters would constantly keep changing as an application grows. A single parameter change would render the test failed. – Mugen Jul 13 '18 at 12:02
  • My intention of capturing the inbound/outbound network/http calls of the application was to analyze the application from a service layer and understand it. I would even suggest re-running the captured calls. – Kshetra Mohan Prusty Jul 13 '18 at 17:28
0

I would suggest to explore frameworks like rest-assured to design test automation on the web API layer.

Also may use stand-alone applications like Postman for testing API layer.

| improve this answer | |
  • Working with postman takes a long time because to submit a single click we need to fill up a lot of form data. What makes you say that it's an excellent way to test the API layer? Also, does every website have an API layer that can be called using an automation framework/postman? – Mugen Jul 16 '18 at 5:59
  • I find it handy to quickly test something and that 's what general opinion is.It can be an excellent supplementary tool if not primary in my opinion. – Vishal Aggarwal Jul 16 '18 at 8:49
  • Mugan, the way question is framed ,it seems unawareness of API testing but then on suggesting something , the comments are received that those things have already been tried.How would a third person know unless and otherwise stated clearly what has been tried and why it didn't work... – Vishal Aggarwal Jul 16 '18 at 11:28
  • 1
    @Mugen, while Vishal Aggarwal could have given more detail in the answer, the most common method of browserless functional automation is to make use of an API. If your web application does not use an API, you need to state this in the question. – Kate Paulk Jul 16 '18 at 11:41
  • @KatePaulk Thank you, Kate! I've updated the question for now. Once I get more information from the Development team I will update this question with a more specific info. For now, a general answer should suffice. I believe that this level of general answer will be helpful not only to me, but also to anyone who's starting out from scratch and trying to automate without using the UI. The general answer is what will help me to get a high-level understanding and then to probe the development team further to get more specific info. – Mugen Jul 16 '18 at 13:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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