본문으로 건너뛰기
cccskills
무료GitHub에 공개

testdriver:captcha

Solve captchas using 2captcha service

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md4.1 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

<!-- Generated from captcha.mdx. DO NOT EDIT. -->

Captcha Solving

TestDriver can solve captchas automatically during your tests. It uses the 2captcha service. This feature works on Linux sandboxes and Windows sandboxes.

Quick Start

const result = await testdriver.captcha({
  apiKey: process.env.TWOCAPTCHA_API_KEY,
});

console.log(result.success); // true
console.log(result.token);   // The solved captcha token

That is all. TestDriver does these automatically:

  • Finds the captcha type on the page
  • Gets the sitekey
  • Solves the captcha with 2captcha
  • Puts the token into the page
  • Starts the callbacks

Supported Captcha Types

TypeAuto-DetectedNotes
reCAPTCHA v2✅Including invisible
reCAPTCHA v3✅Action is auto-detected
hCaptcha✅
Cloudflare Turnstile✅

Getting a 2captcha API Key

  1. Sign up at 2captcha.com
  2. Add funds to your account
  3. Copy your API key from the dashboard

Configuration Options

const result = await testdriver.captcha({
  // Required
  apiKey: '2CAPTCHA_API_KEY',

  // Optional - usually auto-detected
  sitekey: '6Le...',           // Override auto-detected sitekey
  type: 'recaptcha_v3',        // Override auto-detected type
  action: 'submit',            // reCAPTCHA v3 action

  // Timing
  timeout: 120000,             // Max wait time (default: 120s)
  pollInterval: 5000,          // Poll interval (default: 5s)
});

Full Example

import { describe, expect, it } from "vitest";
import { TestDriver } from "testdriver";

describe("Checkout flow", () => {
  it("should complete checkout with captcha", async (context) => {
    const testdriver = TestDriver(context);

    // Navigate to checkout page
    await testdriver.provision.chrome({
      url: 'https://example.com/checkout',
    });

    // Fill out form
    await testdriver.type({ text: 'John Doe', selector: '#name' });
    await testdriver.type({ text: 'john@example.com', selector: '#email' });

    // Solve the captcha
    const result = await testdriver.captcha({
      apiKey: process.env.TWOCAPTCHA_API_KEY,
    });

    expect(result.success).toBe(true);

    // Submit the form
    await testdriver.click({ selector: '#submit' });

    // Verify success
    await testdriver.find({ text: 'Order confirmed' });
  }, 180000);
});

Environment Variables

You can set your API key as an environment variable:

export TWOCAPTCHA_API_KEY=your_api_key_here

Then use it in your tests:

const result = await testdriver.captcha({
  apiKey: process.env.TWOCAPTCHA_API_KEY,
});

GitHub Actions

Add the key to your repository secrets and expose it in your workflow:

- name: Run Tests
  run: vitest run
  env:
    TWOCAPTCHA_API_KEY: ${{ secrets.TWOCAPTCHA_API_KEY }}

How It Works

  1. Detection: Scans the page for captcha elements (data-sitekey, script tags, etc.)
  2. Submit: Sends the captcha challenge to 2captcha's solving service
  3. Poll: Waits for human solvers to complete the captcha
  4. Inject: Injects the solved token into the page's hidden fields
  5. Callback: Triggers any JavaScript callbacks the page expects

Troubleshooting

"Could not auto-detect captcha"

The captcha element wasn't found on the page. Try:

  • Waiting for the page to fully load before calling captcha()
  • Providing the sitekey and type manually

Timeout errors

Captcha solving typically takes 10-30 seconds. If you're getting timeouts:

  • Increase the timeout option
  • Check your 2captcha balance
  • Verify the captcha type is correct

Token not working

Some sites validate tokens immediately. Make sure:

  • The token is injected before form submission
  • The captcha type matches what the site expects
  • For reCAPTCHA v3, the action parameter matches the site's expected action

Requirements

  • Chrome must be launched with remote debugging enabled (automatic on all sandboxes)
  • A valid 2captcha API key with sufficient balance

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

How the TestDriver agent behaves on GitHub issues, pull requests, and @mentions

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

testdriverai/testdriverai4732026년 9월 21일 업데이트

Execute natural language tasks using AI

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

testdriverai/testdriverai4732026년 9월 21일 업데이트

Make AI-powered assertions about screen state

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

testdriverai/testdriverai4732026년 9월 21일 업데이트

Deploy TestDriver on your AWS infrastructure using CloudFormation

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

testdriverai/testdriverai4732026년 9월 21일 업데이트

Speed up tests with screenshot-based caching

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

testdriverai/testdriverai4732026년 9월 21일 업데이트

How TestDriver learns your app and caches what it discovers for instant, deterministic replays

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

testdriverai/testdriverai4732026년 9월 21일 업데이트

testdriverai의 스킬 모두 보기

이 스킬의 문제 신고