hubcap waitnav

Wait for any navigation event to occur.

When to use

Use waitnav to block until any navigation event is detected. Use waiturl to wait for a specific URL pattern. Use waitload to wait specifically for the page load event.

Usage

hubcap waitnav [--timeout <duration>]

Arguments

None.

Flags

FlagTypeDefaultDescription
—timeoutduration30sMaximum wait time

Output

FieldTypeDescription
navigatedboolWhether a navigation event occurred
{"navigated":true}

Errors

ConditionExit codeStderr
Chrome not connected2error: connecting to Chrome: ...
No navigation within timeout3error: timeout

Examples

Wait for navigation after clicking a link:

hubcap click '#next-page' && hubcap waitnav

Wait with a short timeout:

hubcap waitnav --timeout 5s

Click a link and wait for the navigation to complete (chaining):

hubcap click 'a.continue' && hubcap waitnav && hubcap title

See also

  • waitload - Wait for the page load event
  • waiturl - Wait for the URL to match a pattern
  • goto - Navigate to a URL
  • waitidle - Wait for network idle