Which of the following best describes the impact of high network latency on a web application's user experience?
Think about what happens when the network takes longer to send or receive data.
High network latency means data takes longer to travel between the user and server, causing delays in loading pages and responding to user actions.
What will be the output of the following Python test code snippet simulating network delay?
import time start = time.time() time.sleep(2) # Simulate 2 seconds network delay end = time.time() print(round(end - start))
Look at how long the sleep function pauses the program.
The time.sleep(2) pauses execution for 2 seconds, so the printed rounded time difference is 2.
Which assertion correctly verifies that a network request times out within 5 seconds in a test?
response = make_network_request()
# Choose the correct assertion belowTimeout means the request should not take longer than the limit.
Checking that the elapsed time is less than 5 seconds confirms the request timed out properly or completed quickly.
A test simulating 1 second network delay fails because the actual delay is 0 seconds. What is the most likely cause?
Think about what controls network delay simulation.
If the simulation tool is off, no artificial delay is added, so the test sees zero delay.
Which testing framework or tool is best suited for simulating various network conditions like latency, bandwidth limits, and packet loss during automated UI tests?
Look for a tool that integrates UI testing with network control features.
Puppeteer with Chrome DevTools Protocol allows controlling network conditions during UI tests, making it ideal for this purpose.