Starting off as a muggle that naïve to the Math's and Data Science world.

Finetuning LLMs for Automatic Form Interaction on Web-Browser in Selenium Testing Framework

ref: https://arxiv.org/pdf/2511.15168

Summary

Trained a new LLM to understand web form (HTML code) and generate reliable Selenium script for webpage testing. Differ to WebVoyager, which rely on visual navigation (UI Agent). This method model UI automation to a deterministic code generation working on UI/UX. While this improve execution, the approach still suffer typical code generation failure.


Prompt
Generate a test case scenario for filling in a given HTML form, providing step-by-step instructions, dummy data, the expected outcome. The test case scenario must be JSON-formatted.
The goal is to ensure that each form element is filled appropriately, actions are conducted in the correct order. 

# Steps
1. **Form Analysis**: Break down the HTML form into its major fields (e.g., text inputs, radio buttons, dropdowns) and requirements.

2. **Generate JSON Test Case**: 
- Identify each field by its name or identifier.
- Identify if the field is required and only include required fields in the test case.
- Include the html snippet for each form field.
- Include appropriate dummy data for each form field and make sure the date is valid and follows the field’s requirements. For entering date, use format ’mm/dd/yyyy’.
- Specify the instructions for filling out each field in sequential order.
- Mention the expected outcome (e.g., successful submission, error messages indicating missing required fields).
- Exclude the submit button and use the ‘form.submit()‘ method for submitting forms instead of click button.

# Output Format
**Test Case JSON**: - Formatted in a structured JSON that describes the form fields, the data to be filled, step-by-step instructions, and the expected outcome.

### JSON Structure: [Json structure]

Leave a comment