Skip to main content
Automate form submissions using cloud browsers that handle dynamic content, authentication, and bot protection. Browserbase gives you reliable infrastructure for form filling workflows, whether you’re using Stagehand or Playwright.
Looking to deploy form automation as an API? Functions let you package form automation workflows as cloud functions that can be invoked via webhook or API call, perfect for integrating form submissions into your applications.

Implementation

1

Create a session

Create a Browserbase session and authenticate if needed. Use browser contexts to persist authentication across pages.
2

Navigate to the form

Go to the target page and wait for form elements to fully load before interacting with them.
3

Fill form fields

Identify and populate form elements (text inputs, dropdowns, radio buttons, and checkboxes) with your data.
4

Submit and verify

Trigger the submit button and check for success messages or validation errors.

Template

Get started quickly with a ready-to-use form filling template.

Form Filling

Clone, configure, and run in minutes

Example: Automating a Google form

To demonstrate how to automate form submissions using Browserbase, you can use a sample Google Form designed specifically for this tutorial: Google Form This form collects responses in various formats:
  • Text input
  • Radio button
  • Checkboxes

Code example

This example form is for testing purposes - feel free to submit responses multiple times while experimenting.

Best practices

Wait for form elements to load

Target specific form elements with waitForSelector rather than using arbitrary timeouts. This ensures your automation proceeds only when the form is ready.

Handle multi-step and dynamic forms

Forms that reveal fields based on previous selections need sequential interaction. Wait for each new section to render before continuing.

Persist authentication with contexts

Use browser contexts to save login state across form automation runs, so you don’t need to re-authenticate each time.

Verify submission success

Check for confirmation messages, URL changes, or response status after submitting a form.

Next steps

Session live view

Learn how to watch test sessions in real time

Uploads

Learn how to upload files with Browserbase

Browserbase Functions

Deploy form automation as serverless functions