Skip to content
| Marketplace
Sign in
Visual Studio Code>Testing>Selenium to Playwright ConverterNew to Visual Studio Code? Get it now.
Selenium to Playwright Converter

Selenium to Playwright Converter

Ashish Sharda

|
8 installs
| (0) | Free
AI-powered Selenium to Playwright test migration. Bring your own API key. Free forever.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

🎭 Selenium → Playwright Converter (S2P)

AI-powered VSCode extension that migrates your Selenium tests to Playwright in one click.

🆓 100% Free — Bring your own API key from any of 4 free AI providers. No subscriptions. No limits.


⚡ How It Works

  1. Set your API key — Ctrl+Shift+P → Selenium2PW: Set AI Provider API Key
  2. Right-click any Selenium test file in the Explorer
  3. Select "Convert Selenium → Playwright"
  4. A new .playwright.ts file opens side-by-side — done!

✨ Features

  • ⚡ One-click conversion — right-click any Selenium file in Explorer or Editor
  • 🔀 Selection support — convert just a highlighted block of code
  • 🌐 5 input languages — JavaScript, TypeScript, Python, Java, C#
  • 📤 3 output formats — TypeScript, JavaScript, Python Playwright
  • 📊 Usage dashboard — track files converted and tokens used
  • 🔒 Secure key storage — API keys stored in VSCode's built-in secrets vault
  • 📁 Non-destructive — creates a new .playwright.ts file, never modifies the original

🤖 Supported AI Providers

✅ Free Providers — No Credit Card Required

Provider Model How to Get Key
Groq Llama 3.3 70B console.groq.com
Google Gemini Gemini 2.5 Flash aistudio.google.com
OpenRouter DeepSeek R1 (free) openrouter.ai
DeepSeek DeepSeek V3 platform.deepseek.com

💳 Paid Providers

Provider Model
OpenAI GPT-4o
Anthropic Claude Sonnet 4

📝 Conversion Example

Before — Selenium Python:

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait

driver = webdriver.Chrome()
driver.get("https://example.com")
driver.find_element(By.ID, "username").send_keys("admin")
driver.find_element(By.CSS_SELECTOR, ".login-btn").click()
WebDriverWait(driver, 10).until(
    EC.visibility_of_element_located((By.ID, "dashboard"))
)
driver.quit()

After — Playwright TypeScript:

import { test, expect } from '@playwright/test';

test.describe('Login', () => {
  test('user can sign in', async ({ page }) => {
    await page.goto('https://example.com');

    // Auto-wait built in — no more WebDriverWait!
    await page.locator('#username').fill('admin');
    await page.locator('.login-btn').click();

    await expect(page.locator('#dashboard')).toBeVisible();
  });
});

🔑 Getting Started (Free in 2 minutes)

Groq — fastest and most generous free tier:

  1. Go to console.groq.com — no credit card required
  2. Create an API key
  3. In VSCode: Ctrl+Shift+P → Selenium2PW: Set AI Provider API Key
  4. Paste your key — done!

⚙️ Configuration

{
  "selenium2pw.aiProvider": "groq",
  "selenium2pw.outputLanguage": "typescript",
  "selenium2pw.createNewFile": true,
  "selenium2pw.showTokenUsage": true
}
Setting Options Default
aiProvider groq · gemini · openrouter · deepseek · openai · anthropic groq
outputLanguage typescript · javascript · python typescript
createNewFile true · false true
showTokenUsage true · false true

🚀 Commands

Command Description
Selenium2PW: Convert Selenium → Playwright Convert the active file
Selenium2PW: Convert Selected Code → Playwright Convert selected code only
Selenium2PW: Open Usage Dashboard View stats & manage API keys
Selenium2PW: Set AI Provider API Key Store your API key securely

🔒 Privacy

  • API keys stored in VSCode's built-in secret storage — never in plaintext
  • Your code is sent only to your chosen AI provider — not to any other server
  • No account required, no data collected

📬 Support

  • Website: S2P — Selenium to Playwright
  • Email: ashishjsharda@gmail.com

Made for the testing community — happy migrating! 🎭

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft