Skip to main content

Using Web Agent

This guide walks you through using Web Agent to automate web browser interactions, inspect live web applications, and generate robust test automation scripts.


1. Switching to Web Agent Mode

  1. Open VS Code with the PostQode extension installed.
  2. Click the PostQode icon in the Primary Side Bar to open the chat interface.
  3. Click the Mode Selector dropdown at the top of the chat panel and choose "Web Agent".
  4. The interface switches to Web Agent mode with browser-specific skills and tools enabled. PostQode automatically manages the underlying Playwright Chromium instance when tasks are executed.

2. Browser Execution & Configuration Settings

You can customize browser execution behaviors under PostQode Settings () ➔ Browser tab:

Disabling Browser Tool Usage

If you want to prevent PostQode from launching browser windows during a session (for instance, when working in constrained headless server environments or purely code-focused tasks):

  • Toggle Disable Browser Tool in Settings ➔ Browser.
  • When enabled, PostQode will refuse to trigger browser actions and inform you that browser automation has been disabled by user policy.

Session Options & Profile Directories

  • Isolated Session (Default): Creates a fresh, isolated temporary browser profile per task. Cache, cookies, and local storage are automatically cleared on task completion.
  • Persistent Session: Reuses a persistent user profile directory, keeping login cookies and authentication tokens intact across multiple tasks.
  • Custom Profile Directory: Set a custom path for browser profile storage to preserve session state between IDE restarts.
  • Storage State Path: Specify a JSON storage state file (storageState.json) containing pre-authenticated cookies and session tokens.

Network Options & Proxies

  • Custom Proxy Server: Route traffic through corporate HTTP or SOCKS5 proxies (http://username:[email protected]:8080).
  • Custom User-Agent: Override User-Agent strings for mobile viewport emulation or bot-mitigation bypass.
  • Block External Assets: Block non-essential tracking scripts, fonts, and advertisements to accelerate page loads.

Advanced Options & Output Directory

  • Output Directory: Configure the destination folder where screenshots, action logs, and video traces are stored.
  • Action Timeout: Maximum duration (in ms) to wait for selectors and navigation before throwing a timeout (Default: 15000ms).
  • Slow-Mo Execution: Introduce an intentional visual delay (e.g. 250ms) between actions to make automation visually inspectable in non-headless mode.

3. Web Agent Commands & Navigation

Basic Navigation

Go to https://example.com
Navigate to https://github.com/login and take a screenshot

Form & UI Interactions

Fill the email field with "[email protected]", enter password, and click "Sign In"
Select "United States" from the country dropdown and submit the form
Scroll down to the pricing table and extract the enterprise tier feature list

4. Working with Dynamic Content

Waiting for Elements

Go to https://app.example.com and wait for the loading spinner to disappear, then click "Create New Project"

Handling Pop-ups & Modals

Navigate to https://example.com, dismiss any cookie consent banners, and click the primary "Get Started" button

5. Generating Automation Scripts

After completing an automation session, you can ask PostQode to export reproducible automation test scripts:

Generate a Playwright TypeScript test script for the login and dashboard verification workflow just performed.
Export this multi-step form workflow as a Python Selenium test script.