Writing Tests with the AI Editor
Learn how to write and manage tests using Posium's AI Editor
Generating Tests Using the AI Agent
You can use the Posium AI agent to automatically generate functional tests for your application β no manual scripting required. This guide walks you through how to generate a login test using the AI agent.
π‘ Tip: AI-based test generation is free. Only test execution consumes credits.
π§ Prerequisites
Before generating tests:
- Ensure your project is set up and accessible
- Save required variables like
username
,password
, and any other environment-specific inputs in the Project Settings section - Confirm that the Run Agent button is visible on the project dashboard
π Steps to Generate a Test
-
Click
Run Agent
- This launches the test generation workflow
-
Select a Project
- Choose the relevant project (e.g. staging or production)
-
(Optional) Select a Dependency
- If your test builds upon an earlier one (e.g. login flow), you can select it
- Otherwise, leave this blank for independent tests
-
Choose a Test Scenario
- For example:
Render base URL and login with credentials
- For example:
-
Run the Agent
- The AI agent spins up a browser (Chromium-based by default)
- It loads the base URL from your project settings
- It automatically fills in the login form using
username
andpassword
stored in the project settings - It clicks βSign Inβ and verifies that login is successful by checking UI elements like the user menu
-
Watch the Test Run
- You can inspect every test step that is generated
-
Save the Test
- Once the steps look good, click Save
- The test is now available in your project
π Viewing Your Generated Tests
- Go back to your Project Dashboard
- Open the Tests tab
- Your new test will appear alongside existing ones
- Click into any test to review or edit it
β Notes
- The AI agent uses the credentials and environmental variables configured in Project Settings to generate realistic, runnable tests
- You can generate as many tests as you want β AI usage is free
- Only when you execute the test are credits consumed