LogoLogo
BugBug HomepageContact SupportLoginSign up free
  • Documentation
  • Tutorial for beginners
  • Best practices
  • BugBug App FAQ
  • Quick Start
    • What is test automation?
    • Start for free
    • Create your first project
    • Install Chrome extension
    • Create and run the tests
  • Creating Tests
    • Your first test
    • Independent tests
    • Duplicating tests
    • New test from here
  • Recording tests steps
    • BugBug overlay
    • Recording clicks
    • Recording hover
    • Recording keyboard typing
    • Recording assertions
    • Recording drag & drop
    • Record from here
    • Re-recording steps
    • Recording pop-up window actions
    • Using keyboard shortcuts
  • Editing tests
    • Grouping steps
    • Components
    • Manually editing steps
    • Actions
    • Assertions
    • Tabs & iframes
    • Variables
    • Local variables
    • Profiles
    • Custom JavaScript actions
  • Running tests
    • Running the tests
    • Statuses
    • Run (locally)
    • Run and pause here
    • Run in cloud
    • Schedules
    • Parallel runs
    • Running via API
    • Test your local build or protected web page using ngrok
  • Preventing failed tests
    • Waiting conditions
    • Smart click
    • Smart scroll
    • Selectors
    • Timeout
    • Delay / Sleep
    • Project settings
  • Debugging Tests
    • Runs history
    • Screenshots
    • Debug in Chrome
    • Breakpoint (run step-by-step)
  • Organizing tests
    • Naming your tests
    • Searching tests
    • Suites
    • Components
    • Projects
  • Workflow Tips
    • Edit & Rewind
    • Changing the test screen size
    • Multiple environments
    • Testing registration & login
    • Integrating with build systems
    • Mobile version testing
  • Collaboration
    • Organizations
    • Inviting team members
    • Alerts
      • Sending email notification
      • Sending webhook
      • Sending Slack message
      • Sending Teams message
  • Integrations
    • CLI
    • Zapier
    • Slack
    • GitHub
    • Bitbucket
    • Gitlab
    • Trello
    • Jira
  • Your account
    • Account settings
    • Edit your name and email
    • Forgot password
    • Manage Subscriptions
    • Account FAQ
  • Troubleshooting
    • Prohibited behaviors
    • Updating Chrome extension
    • Clear cookies and site data for BugBug
    • Testing basic auth password protected websites
    • Common selectors issues
    • CAPTCHA in automation testing
    • Cloud tests sometimes failing
    • IPs list of cloud runners
    • VPN or a Firewall
    • A/B tests
    • Report a bug
  • IN-DEPTH GUIDES
    • Beginners tutorial to automation testing
    • XPath Selectors without coding
    • Tech Leader's Guide to Automation Testing
    • Test automation guides
  • FREE TOOLS
    • BugBug Testing Inbox
    • Example SaaS App
    • No-code XPath Selector Builder
  • Other links
    • BugBug Homepage
    • Pricing
    • Terms & conditions
    • Privacy Policy
Powered by GitBook
On this page
  • Smart waiting before running a step
  • Available waiting conditions
  • Document readyState is complete
  • Page network requests are finished
  • Element is visible
  • Element is not covered by the other one
  • Element is not animating
  • Element must be active
  • Element has focus
  • Element has an attribute
  • Page will navigate after step execution
  • Enable or disable waiting conditions
  • Skipped waiting conditions

Was this helpful?

  1. Preventing failed tests

Waiting conditions

Smart waiting before running a step

Before running each test step, BugBug will do a series of checks if your page is ready for this action.

For example, before BugBug tries to click a button, it will check if the page finished loading, if the button exists and if it's visible. If those conditions are met, BugBug will attempt to click the button. Such conditions are called "Waiting conditions".

Benefits:

  • more stable tests

  • you don't need to hardcode manual delays

  • more intelligent tests running, behaving more like a human and not a machine

Available waiting conditions

Document readyState is complete

BugBug waits until your page is ready to interact with and if all the basic assets are loaded. In technical terms this is waiting for onload window event.

Page network requests are finished

BugBug waits until your page has finished loading additional data via other network requests.

Even after the page is loaded, your web app needs to request additional data from a server. BugBug will wait until your server requests are more or less finished - by default BugBug will stop waiting when there are not more than 2 unfinished requests for more than 1 second. You can change this in Project Settings.

Element is visible

BugBug will not interact with the element until it is visible. For example, if you have a "Done" button than only appears after several seconds, BugBug will wait until it appears. That's why you should avoid adding manual delays/sleep.

Element is not covered by the other one

Same as in "Element is visible" above. BugBug will try not to click something that is covered by another element.

Element is not animating

This ensures that the animation of the element stopped before BugBug interacts with it.

For example, if you have a collapsed section that expands with an animation, BugBug will wait until it is fully expanded before interacting with its contents.

This waiting condition is enabled if during the recording you clicked an element that was not animating. If the element has a looping animation, BugBug will disable this waiting condition by default.

Element must be active

This applies to form elements, that can have a disabled attribute. BugBug will hold the step execution until the form element is active. This waiting condition is automatically disabled if during the recording you actually clicked on a disabled element.

Element has focus

This applies to text input elements. BugBug will wait before typing the letters until it verifies that a text input or textarea has focus, (meaning that the blinking typing cursor is present the right field)

Element has an attribute

BugBug will check if element has a attribute with expected value, before interacting with it.

You can add this waiting condition manually, by clicking on "Add condition" in step's "Waiting condition" section.

It requires the expected value to be specified using a specific pattern: key="value", where key is the attribute name and value is the expected attribute value, e.g. class="bugbug".

Page will navigate after step execution

This is a special waiting condition that is added automatically by BugBug while recording. If BugBug notices that after a click there's a change in the URL, BugBug will not continue running the next step immediately - it will wait until the URL changes. This also applies to URL history state changes for Single Page Applications.

Enable or disable waiting conditions

Global waiting conditions can be set up in the project settings.

You can override waiting conditions per each step. Sometimes you need to disable one of them to prevent unnecessary failed tests.

Skipped waiting conditions

If some waiting conditions are not met, BugBug will anyway try to perform the action. For example, if the page networking has not finished, BugBug will anyway click the button after 30 seconds.

PreviousTest your local build or protected web page using ngrokNextSmart click

Last updated 6 months ago

Was this helpful?

You will be notified about skipped waiting conditions by a different green indicator

More about test statues