Why are waits difficult to implement correctly?
All automation tools have ways to determine what to do when an element does not exist. The most common solution is to wait until the object exists. WebdriverIO has an option to adjust the timeout for elements in the wdio.config.json
file:
// Default timeout for all waitFor* commands. waitforTimeout: 10_000,
The default is 10 seconds. For years, the most common choice was to wait 30 seconds. The problem was, depending on our tool, if our script navigated to the wrong page, that timeout might happen on every element. That is a long time to wait for the script to finally end if a lot of elements do not exist.
Back in 2000s, the founder of WorkSoft, Linda Hayes, noted that there is a way to calculate a good wait timeout for our framework. Take the average time for our slowest page to render and triple it. This means we will anticipate a load will be added to our application under test and can be flexible enough to handle it.
Different...