Submitting web forms is a common scenario in automation since it allows you to efficiently transfer data and run multiple scenarios.
Overview
In this guide, you will how to use an Playwright methods in a AgentQL script to automate submitting a form.
Common scenarios
Here are some common scenarios for filling out forms with Playwright and AgentQL.
Use Playwright's fill()
to fill an text input field. It accepts the desired value as an argument.
Select an option from a dropdown or selection box
Use Playwright's selection_option()
method to select an option from a dropdown or select box. It accepts an option (or set of options for multiselect). See Playwright's docs for more.
Upload a file
Use Playwright's FileChooster
to upload a file to a form.
Conclusion
Automating form submission allows you to unlock powerful workflows with AgentQL.
Here is a complete script that include examples of filling out the form and selecting options using this test form website.
Related content