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

QA Fundamentals › Web and client-server

What happens when you enter a URL

The browser finds the IP through DNS, opens a connection (plus a TLS handshake for HTTPS), sends the HTTP request, gets the response and builds the page. Each stage fails differently: a DNS error, a refused or timed-out connection, a certificate error, 502 or 504 from a gateway, a blank page with 200. The Timing tab shows the breakdown: long waiting points to the server, long DNS or connect to the network.

QA Fundamentals · Web and client-server

You typed an address and pressed Enter. What happened before the page appeared and at which step could it break?

A user writes: "The site does not open". For QA this is a template for dozens of different faults: the domain does not resolve, the server does not listen on the port, the certificate is expired, a gateway did not wait for the application, a script crashed while the page was being built. Each lives at its own step of the path from the typed address to the finished page, and the browser usually says which. This lesson splits the path into stages, explains why they are separate and teaches how to find the stage by a symptom.

How it works and why. The internet is built in layers, and each solves one task. DNS looks up an IP address by name: the browser asks its own cache, the OS cache, then the provider's resolver, which if needed queries the root, TLD and authoritative servers. Next a connection is needed: TCP sets it up in three steps (SYN, SYN-ACK, ACK), and HTTP/3 uses QUIC over UDP with built-in TLS instead of TCP. For HTTPS a TLS handshake follows: the server sends a certificate, the browser checks that it was issued by a trusted authority, is valid and matches the domain, and the sides agree on keys. Only then does the browser send an HTTP request with a method, headers and cookies. On the way it may pass through a CDN, a load balancer and a reverse proxy before reaching the application server. The server turns to a database or other services and returns a response. Finally the browser builds the page.

The path from an address to a page

1. DNSdomain name → IP address2. TCP (or QUIC for HTTP/3)a connection to the server3. TLS (for HTTPS)certificate, encryption keys4. HTTP requestthrough a CDN, a balancer, a proxy5. Server responsestatus, headers, HTML6. The browser builds the pageDOM, CSS, JS, painting
Figure 1. Each step can break in its own way and with its own symptom. The last one is highlighted: the server has already answered and the problem is in building the page.

Splitting into layers is not a formality. Thanks to it the certificate is checked before a single byte of a request with a password goes out, DNS can be changed without touching the application, and a CDN or a balancer can be put in front of the server without the client or the server noticing. The practical conclusion for QA: once the stage of the failure is found, the circle of suspects shrinks from "everything" to one layer. Splitting by stage in the browser: in Network the Timing tab shows how much time each took:

The Timing tab (illustrative values for the example)
Queueing                         2 ms
DNS Lookup                      28 ms
Initial connection              35 ms
SSL                             41 ms
Waiting for server response    612 ms   ← waiting for the server
Content Download                14 ms

Building the page has steps too. The browser reads the HTML and builds the DOM, at the same time loading CSS (from which the CSSOM is built) and scripts. Having combined the DOM and the styles, it computes the position of elements (layout), draws them (paint) and assembles the layers into a picture (composite). A script without defer or async stops HTML parsing, and CSS blocks showing the page until it loads. That is why a heavy script in the head of the page gives a "white screen" even though the server answered quickly. In modern SPAs the first response often holds an almost empty HTML, and the data arrives by additional API requests after JavaScript has run.

Example: from "the site does not open" to a stage. We start with what the browser showed:

What we seeStageWhat to check
ERR_NAME_NOT_RESOLVEDDNSThe domain is correct, the DNS record (nslookup or dig), whether DNS was changed recently
ERR_CONNECTION_REFUSED or ERR_CONNECTION_TIMED_OUTTCPWhether the server listens on the port, whether a firewall blocks it, whether the node is down
NET::ERR_CERT_DATE_INVALID or ERR_CERT_COMMON_NAME_INVALIDTLSCertificate validity period, match with the domain, the full chain
502 or 504Gateway or proxyWhether the application behind the gateway answers and has enough time
200 and a white pageBuilding the pageConsole for errors, Network for requests that failed to load

If the stage of the error is visible at once, the report is concrete. If the complaint is "slow", we look at Timing: in the example above DNS, connection and TLS take tens of milliseconds, while waiting for the server response takes 612 ms. So it is exactly the processing on the server (or in the services behind it) that is slow, not the network, and the ticket goes to the back end with this evidence. If it were the other way round (DNS in hundreds of milliseconds, waiting small), the question would go to the network or the DNS settings.

Limits and alternatives. The scheme is simplified. Repeated requests are cheaper: DNS and the connection come from a cache, and the HTTP cache may answer without going to the network at all (so tests are run with the cache disabled and on a "cold" start). Connections are often reused (keep-alive), so stages 1-3 happen only for the first request. HTTP/2 and HTTP/3 send several requests in parallel over one connection. A redirect from HTTP to HTTPS or to another domain adds one more round. A Service Worker can answer by itself without going to the network. VPNs, corporate proxies and DNS filters add their own failures that "do not reproduce" for the developer. In an interview the depth depends on the level: for a junior it is enough to name DNS, a connection, an HTTP request, a response and rendering, while from a senior an explanation of what happens at each stage and what breaks there is expected.

Common mistakes.

  • Calling everything that did not open a "site bug": a DNS or certificate error is an infrastructure problem, not an application one, and the ticket must go to another addressee.
  • Looking for an HTTP status where it cannot exist: when the certificate check fails or the connection is refused, the request does not reach the server at all.
  • Testing only with a warm cache: new users go the full path with everything downloaded.
  • Confusing a "slow server" with a "slow network" without looking at the time breakdown.
  • Forgetting about blocking resources: a "fast back end" does not guarantee a fast display of the page.

Check yourself

The browser shows ERR_CONNECTION_TIMED_OUT, and nslookup returns an IP address of the domain. Which stage is already fine and where do you look?

Answer

DNS is fine: the name turns into an address. The problem is at the connection step (TCP): the node does not answer, the port is closed or a firewall drops the packets. I check the availability of the host and the port, whether the server is running and whether network rules were changed.

In Timing DNS is 25 ms, connection 30 ms, TLS 40 ms and waiting for the response 700 ms. Whom do you address the "slow" complaint to?

Answer

The back end: the network stages are fast and 700 ms went to waiting for the response, that is, to processing on the server or in the services behind it. In the ticket I give the breakdown and the request.

Why, with an expired certificate, will you not see the site's response status code in DevTools?

Answer

The TLS handshake happens before the HTTP request. The browser stops the connection at the certificate check and shows a warning page, so there is no request to the application and no response with a status either.

In an interview. Junior: The browser parses the URL and finds the IP address through DNS, sets up a connection (for HTTPS also a TLS handshake), sends an HTTP request, gets a response and builds the page from HTML, CSS and JS. Middle/Senior: I tie symptoms to stages: ERR_NAME_NOT_RESOLVED is DNS, a refused or timed-out connection is TCP, a certificate error is TLS, 502 or 504 is a gateway, and a white page with 200 is building the page. I take the time breakdown from Timing: a long wait for the response points to the server, long DNS or connection to the network. I remember that caches, keep-alive, CDNs and Service Workers shorten the path, so I test a "cold" and a "warm" request separately.

More articles in this chapter