Loading and waiting
Results that take a moment. A test that does not wait for them fails here, so it is the place to practise waiting.
1. Results behind a spinner
The button asks the server for three results; the server answers after 1.5 seconds. Meanwhile a spinner is shown. Every click draws the list again, so elements found before the click are gone afterwards.
Loading…Loads: 0
2. A message that appears later
The message appears 2 seconds after the click, without a spinner.
Here I am, two seconds later.
3. A call made with jQuery
The same request, made with $.ajax, without a spinner. VAF waits until jQuery has no request
running before it looks for a section, so the text below is already updated when the test reads it.
Status: Not loaded
What to practise
- Tell VAF which element is the loader (
LetsUseLoader), click, and read the results. - Click twice and read the list again: the old elements are stale.
- Wait for the late message without a fixed sleep.
?delay=in the address of the request changes the wait (0–5000 ms).
Waiting in VAF: guide, section 6.