QA Interview Hub · Knowledge base · Quizzes · Українська

QA Fundamentals › Web and client-server

A front-end or back-end bug through DevTools

Four questions tell a front-end bug from a back-end one: was the request sent, is it per contract, is the response per contract, does the screen show it. The first no shows where the bug is. Network shows the request and response, the server is isolated by replaying via Copy as cURL or Postman, the UI by overriding the response. The judge is the contract, not anyone's confidence.

QA Fundamentals · Web and client-server

The data on the screen is wrong. Is the error in the request, in the server response or in how the page showed it?

The product card says "UAH 1,999.00", but it should be 19.99. The ticket flies to the developers: the front end says it shows what the server gave, the back end says it returns the right thing and the front end formats wrongly. QA is left between two claims that nobody checked. This lesson is about a sequence of four questions that answers in a few minutes whose bug it is, and about why the judge is always the contract and not somebody's confidence.

How it works and why. Between a user's action and what they see there are four points, and each can be checked separately: the request went out, the request is right, the response is right, the screen shows what is in the response. The first "no" in this chain shows where the bug is. The principle is simple: we check from the start of the flow to the end and do not guess. Why in this order? Because each next step makes sense only if the previous one passed: there is nothing to compare with the response if there was no request.

Four questions

1. Did the request go out at all?no → client (Console, event handler)2. Is the request per the contract?no → client (fields, format, headers)3. Is the response per the contract?no → server (code, data, error)4. Does the screen show the response?no → client (parsing, state, display)
Figure 1. The last check is highlighted because it is skipped most often: the response is right, and the error is blamed on the server.

Tools for each question: in Network we find the request by the action (the Fetch/XHR filter), in the Headers and Payload tabs we read what was sent, in Response or Preview we read the answer. If there is no request, we look at Console for script errors. To separate the server from the browser, we reproduce the request through Copy as cURL or in Postman. To separate the interface from the server, in Chrome the response can be replaced (Local overrides or Override content in Network) to see how the page handles a different response.

What counts as "right" in questions 2 and 3 is decided by the contract: the API specification (Swagger/OpenAPI), the documentation or the requirements. Without it the argument "who is wrong" has no solution, because both sides see only their own logic.

Example: two cases with the same symptom and different culprits. The first: a wrong price. We look at the response to the product request:

GET /api/products/42 HTTP/1.1

HTTP/1.1 200 OK
Content-Type: application/json

{"id": 42, "name": "Headphones", "price": 1999, "currency": "UAH"}

The request is right, the response is 200 and structurally valid. Question 3 is decided by the contract. If the specification gives the price in minor units (cents), the response is right and the interface had to divide by 100: a client bug (question 4). If the specification says "the price is in hryvnias", then 1999 is a server defect (question 3). The same screenshot and the same JSON, but the culprit depends on a document. The second case: a transfer with an amount of three decimal places.

POST /api/transfers HTTP/1.1
Content-Type: application/json

{"from": "acc-1", "to": "acc-2", "amount": "100.555"}

HTTP/1.1 422 Unprocessable Content
Content-Type: application/json

{"code": "too_many_decimals", "field": "amount"}

Here the server response is right: 422 with a reason code. So question 3 is "yes". But the interface shows "Something went wrong" and does not point to the field, or the form itself did not stop an input with three decimals. These are client bugs, one about displaying the error, the other about missing client validation. A report to the server would be wrong: it works per the contract. At the same time checking that the server rejects such input is useful too, and it is a separate positive result worth recording.

Limits and alternatives. Reality does not always fit "client or server". The error may be on both sides or in the contract itself (it was written ambiguously): then the report goes to the analyst or to both teams with a request to resolve the discrepancy. A response in cURL may differ from the response in the browser: because of other headers, authorisation, cookies or a cache, so the discrepancy itself becomes a hint. Some bugs depend on order: two requests came back in reverse order, and an older response overwrote a newer one. This is visible by time in Network, and the cause is on the client even though both responses are right. If the page is built by the server (server-side rendering), a "visual" bug may be a server one. Statuses help but do not decide: 5xx is most often the server, and a 4xx must be considered by the contract, because the client could have sent something incorrect. Also tell a 500 from your application from a 502 or 504 from a gateway.

Common mistakes.

  • Starting from the assumption "it is the front end" or "it is the back end" and looking only for confirmation.
  • Looking only at the status and not opening the request and response bodies.
  • Not having the contract at hand: then the argument turns into "it works for me".
  • Ignoring the time and the order of requests: races between responses are not visible in a static snapshot.
  • Not adding the request and the response to the report: the developer walks this path again.

Check yourself

The request is right, the response is 200 with correct data, but the screen shows old information. Which of the four questions gave "no" and what do you check?

Answer

The fourth: the screen does not show what is in the response. I check Console, whether a handler crashes, whether the state updates correctly, whether a cached copy is shown, and whether an older response overwrote a newer one by time in Network.

The API returns price: 1999 and the interface shows "UAH 1,999.00". How do you decide whose bug it is?

Answer

By the contract. If the specification says the price is in minor units, it is a client bug: it must divide by 100. If the price is in hryvnias, it is a server bug. Without the document it cannot be decided, so for the first question I demand or find the specification.

Why is it useful to reproduce the request through cURL or Postman when the bug is in the UI?

Answer

It separates the server from the browser and the interface. If cURL gives the right response and the UI shows something wrong, the cause is on the client or in a difference of request conditions (headers, token). If cURL gives the same wrong response, the bug is on the server.

In an interview. Junior: I open the Network tab, find the request and look at the request and the response. If the request is wrong, it is the front end. If the request is right and the response is wrong or an error, it is the back end. If the response is right and something else is shown, it is the front end. Middle/Senior: I go through four questions: did the request go out, is it per the contract, is the response per the contract, does the screen show the response. I take the specification as the judge, because without it the argument has no solution (a price of 1999 can be right if it is in cents). I separate the server by repeating the request through cURL or Postman, and the interface by replacing the response. Sometimes the cause is on both sides or in the contract itself, then I go to the analyst. In the report I add the request, the response, the time and a requestId.

More articles in this chapter