🎭 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
- Set your API key —
Ctrl+Shift+P → Selenium2PW: Set AI Provider API Key
- Right-click any Selenium test file in the Explorer
- Select "Convert Selenium → Playwright"
- 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
💳 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:
- Go to console.groq.com — no credit card required
- Create an API key
- In VSCode:
Ctrl+Shift+P → Selenium2PW: Set AI Provider API Key
- 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
Made for the testing community — happy migrating! 🎭