Better routines

Why Wait Steps Make Web Routines More Reliable

Understand page-load, element, and text waits in web automation. Learn when a condition works better than a fixed delay in a Tapper routine.

A look at what’s next. Screens and detailed feature guides preview the upcoming 1.0.6 update. The App Store currently offers 1.0.5. Release details

A wait step pauses a web routine until a specified condition is true or its timeout is reached. It is useful when the next action depends on the page being ready. A fixed delay says “pause for this long”; a condition wait says “look for this state before continuing.”

Tapper’s upcoming routine editor includes page-load, element, element-disappearance, and text waits for supported webpages. Choosing the right one can make a sequence easier to understand and diagnose. It cannot guarantee that a website will respond, and it does not turn a missing condition into a successful result.

Start with the dependency in plain language

Before selecting a wait type, finish this sentence: “The next step is valid only when…” A hypothetical answer might be “the details button is available,” “the loading panel has disappeared,” or “the expected result phrase is visible.”

That sentence tells you what the routine actually needs. If you cannot name a dependency, a condition wait may be unnecessary. A simple pause for reading or pacing can be expressed as a delay without pretending it proves anything about the webpage.

Separate the action that causes a change from the condition that confirms readiness. A tap may request a panel to open. A wait can then check for the control inside that panel. The final tap acts only after the necessary state is found.

The tap-sequence planning article provides a worksheet for putting each action beside its dependency. It is a helpful first step when a routine has become a confusing collection of pauses.

Choose among the available conditions

Wait type What it checks in the upcoming implementation What it does not prove
Page load Document readiness is complete Every later data update has arrived
Element One matching element is visible and enabled Pressing it will produce the intended outcome
Element disappearance No match exists, or one match is not visible A previous operation succeeded
Text The page body’s visible-text representation contains the phrase The phrase is new or belongs to the right result

The wording of the condition matters. “Wait for page” is not equivalent to “wait for the final data.” “Wait for text” is not equivalent to “wait for this action to finish.” Choose a condition that corresponds as closely as possible to the actual dependency.

If you need several facts to be true, think through their order rather than assuming one broad wait covers them all. For example, a document can finish loading before a particular control becomes enabled.

Page-load waits check the document

Tapper’s upcoming page-load condition checks whether the document reports its readiness as complete. That can be useful after a supported refresh. It provides a document-level checkpoint before the routine continues.

Modern pages can load additional information after their initial document is ready. MDN distinguishes document parsing from other loading events in its DOMContentLoaded documentation. The practical implication is that general page readiness and the appearance of your required content are separate questions.

If a hypothetical status table is populated after the page frame loads, a page wait alone may be insufficient. Follow it with a relevant element or text condition if the supported task requires that table’s contents.

Also keep the page context in mind. Tapper’s upcoming executor checks the expected URL before actions and can stop when navigation changes it. A page-load wait should not be presented as a promise of arbitrary multi-page automation. Plan within the supported page context and test the actual transition.

Element waits check for a usable target

An element wait is useful when the next action depends on a specific control being present and available. In the upcoming implementation, the selector must match one element that is visible and enabled. This avoids treating several ambiguous matches as a clear target.

For a hypothetical expandable panel, select the intended button inside that panel after opening it manually. The routine can then wait for that button before trying to use it. This connects the wait directly to the next action’s dependency.

A visible element is still not a guarantee of a successful outcome. The page may reject an automated event, or the control may perform a different task in the current state. Check the result after the action rather than treating the wait as proof that the whole sequence worked.

The target-selection comparison explains structural references and ambiguity. A wait that depends on the wrong selector will be just as misleading as a tap aimed at the wrong control.

Disappearance waits need context

Waiting for a loading indicator to disappear can be useful, but absence alone is easy to misinterpret. The indicator may already be absent before the preceding action begins. A wait that immediately passes in that state has not confirmed any new work.

If you use a disappearance condition, establish why the element should be present first. A hypothetical sequence might request a panel update, verify the expected loading state where appropriate, then wait for that state to disappear. The final result still needs inspection.

In Tapper’s upcoming implementation, this condition passes when no matching element exists or when one matching element is not visible. Multiple matching elements do not provide a clear single-target disappearance condition. Choose a selector that fits the actual page.

Do not equate “the spinner is gone” with “the request succeeded.” A spinner can disappear after an error too. Add a result check that distinguishes the desired content from an error message or an unchanged page.

Text waits should use specific, meaningful phrases

A text wait checks whether the page’s visible-text representation contains the chosen phrase. It is useful when a result has a stable, recognizable label. It is weaker when the phrase is common, already present, or repeated in several unrelated parts of the page.

Before using a phrase, search visually for it in the starting state. If “Ready” already appears in the header, waiting for “Ready” cannot prove that a new panel is ready. A more specific phrase tied to the intended result may help, provided it remains stable and truthful for that state.

The upcoming implementation performs a direct substring check, so capitalization and the actual text matter. Do not assume a loosely similar phrase will match. Dynamic values, localization, and extra wording can affect whether the chosen condition appears as expected.

For a hypothetical practice result, choose a phrase that belongs only to that exercise. Avoid putting private information into routine notes merely to make a condition more specific. The goal is a clear state signal, not a broad collection of page content.

A timeout is a useful result

A timeout means the required condition was not observed within the allowed period. That should lead to inspection, not automatic optimism. The condition may be wrong, the page may be slow, or the preceding action may not have produced the expected state.

Choose a timeout based on what you observe during normal manual use, with reasonable room for variation. An extremely short timeout can stop a valid but slower transition. An extremely long timeout can delay discovering that the expected element will never appear.

After a timeout, compare the page with the condition. Is the target absent, disabled, hidden, or different? Is the text present with different capitalization? Did the previous step act on the wrong control? A precise diagnosis is more valuable than repeatedly increasing the timeout.

The missed-tap article explains how to find the first incorrect step. A wait often reveals a problem caused earlier in the sequence.

Build one hypothetical dependent sequence

Imagine a supported practice webpage with a button that reveals a second control after a variable delay. The intended task is to open the section and tap that second control once. A simple plan could be:

  1. Start with the section closed and the first button visible.
  2. Tap the button that opens the section.
  3. Wait for the specific second control to become available.
  4. Tap the second control once.
  5. Inspect the visible practice result and stop.

This example uses a condition because the second action depends on availability, not on a particular number of seconds. It still requires a correct target, a sensible timeout, and a visible result check.

Run one repetition first. If the task works, inspect the ending before adding another pass. The first pass leaves the section open, so the next pass may need a different starting action. The repeat rules article explains why waits cannot fix an incorrectly designed loop.

Keep intentional delays where they help

Condition waits do not replace every pause. You may want a short delay so you can watch a result, read a line, or distinguish separate actions. That is a valid pacing choice even when the page is already ready.

The distinction is whether the pause is intended for time or evidence. “Give me a moment to inspect the counter” is a delay. “Continue once the next control is available” is a condition. Naming the purpose makes later editing easier.

The click-interval article explains how configured delays, hold durations, and loop delays contribute to total time. A sequence with waits has variable duration because the conditions may become true at different times.

Avoid choosing very long fixed delays solely to conceal uncertainty. A clear condition plus an appropriate timeout often produces a more understandable routine, even when it does not make the task faster.

Review waits after a website change

A saved wait is tied to the website’s structure or text at the time you created it. A renamed button, changed result phrase, or redesigned loading indicator can invalidate that assumption. Review waits alongside tap targets when a familiar routine starts failing.

Use Edit routine to inspect each wait’s purpose and the step after it. Remove conditions that no longer correspond to the task. If you cannot explain why a wait exists, restore the starting state and observe the transition manually before keeping it.

The record and replay guide describes the review workflow, while checking automation results explains how to validate the final outcome. A routine that passes every wait can still perform the wrong task if the conditions were poorly chosen.

These advanced controls are part of Tapper’s upcoming 1.0.6 redesign. Check the installed version and available access before relying on the exact interface. Start with one clear dependency on a supported webpage, one short run, and a result you can see.

TRY IT WITH TAPPER

A good routine starts small.

Open the official App Store listing, check the available version, and try a supported webpage.

Download for iPhone
KEEP EXPLORING

One useful idea
leads to another.

All articles