---
title: 云中的剧作家自动化
description: 用TestingBot大规模运行自动化的Playwright测试。用基于云的浏览器网格连接你的Playwright脚本。
source_url:
  html: https://zh.testingbot.com/features/automation/playwright
  md: https://zh.testingbot.com/features/automation/playwright.md
---

剧作家云 
# 在真正的浏览器云上运行 Playwright

将您现有的 Playwright 测试套件连接到 TestingBot 的测试网格，即可在 6100+ 个真实浏览器和 Android 设备上运行测试。支持大规模并行测试、生成测试工件，并符合 GDPR 标准，支持欧盟数据驻留。

选择框架？请参阅[Playwright 与 Selenium 的](https://zh.testingbot.com/playwright-vs-selenium)对比分析。

[免费开始](https://zh.testingbot.com/users/sign_up) [申请演示](https://testingbot.com/demo)

- **浏览器和设备:** 6100+
- **平行会议:** 20岁以上
- **正常运行时间服务级别协议:** 99.9%

被世界上一些最具创新性的公司所信任

 30秒回答 
## 为什么要在 TestingBot 上运行 Playwright？

真正的浏览器，而不仅仅是 Chromium。

TestingBot 会在真实的 Windows、macOS 和 Linux 机器上，使用真实的 Chrome、Firefox、Edge 和 WebKit 浏览器运行您的 Playwright 测试套件。而 Microsoft Playwright Testing 仅支持在 Linux 系统上使用 Chromium 浏览器。

可预测的价格

套餐包含无限测试时长。不按分钟计费，不收取额外报告费，也不会在CI测试出现问题后的第二天早上收到意外账单。

真正的安卓设备

摆脱 Playwright 的移动模拟，在我们的云端真正的 Android 手机上运行您的流程，同时还能使用相同的桌面套件。

 什么是剧作家？ 
## 60秒速成剧作家

 ![Playwright](https://zh.testingbot.com/assets/support/playwright-2dcb4e75b55ac0d1135cfa47be6137b13f46a2047ce78b96a34f51b0e2cc0d96.svg)

### Playwright

Released 2020 · Microsoft · Apache 2.0

Playwright 是微软开发的端到端测试框架，它通过一个 API 即可驱动 Chromium、Firefox 和 WebKit 浏览器。它由 Puppeteer 的原班人马打造，在开发过程中充分考虑了跨浏览器支持和现代 Web 应用的需求。

自动等待、网络拦截、多标签页支持和浏览器上下文等功能均已内置。官方的 @playwright/test 测试运行器也包含在框架中，因此除非您需要，否则无需额外安装 Mocha、Jest 或 PyTest。

- TypeScript / JavaScript / Python / Java / .NET 绑定
- 自动等待、网络拦截、固定装置、跟踪
- Chrome、Firefox、WebKit · 有头和无头模式
- 内置测试运行器、并行工作线程、重试机制
- 视频、屏幕截图和日志

 5线设置 
## 将你的测试指向 TestingBot 网格

重用您现有的 Playwright 代码。将 wsEndpoint 设置为 TestingBot 的云端，您的测试即可在真实的浏览器和操作系统上并行运行。

playwright.config.ts step 1

```typescript
// Connect to TestingBot's Playwright cloud
import { defineConfig } from '@playwright/test';

export default defineConfig({
  use: {
    connectOptions: {
      wsEndpoint: 'wss://cloud.testingbot.com/playwright?
        key=KEY&secret=SECRET&browser=chrome',
    },
  },
  workers: 10,
  trace: 'on',
});
```

login.spec.ts step 2

```typescript
// Your existing Playwright test, unchanged
import { test, expect } from '@playwright/test';

test('login redirects to dashboard', async ({ page }) => {
  await page.goto('https://app.example.com/login');
  await page.getByLabel('Username').fill('jane');
  await page.getByLabel('Password').fill('••••');
  await page.getByRole('button').click();

  await expect(page).toHaveURL(/\/dashboard/);
});
```

有关[Playwright 的功能、视频录制和选项，请参阅 TestingBot 上的完整文档](https://testingbot.com/support/web-automate/playwright)。

 TestingBot 与 MPT 
## TestingBot 与 Microsoft Playwright 测试对比

如果您完全依赖微软技术栈，Microsoft Playwright Testing (MPT) 是一项很有用的服务。但对于其他情况，TestingBot 则是一个更全面的云解决方案。

| 能力 | 测试机器人 | 微软剧作家测试 |
| --- | --- | --- |
| 浏览器 | 在真实操作系统上运行的真实 Chrome、Firefox、Edge、WebKit | Chromium 仅在 Linux 上可用 |
| 操作系统 | 真正的 Windows、macOS 和 Linux | 仅限 Windows 和 Linux |
| 定价 | 套餐包含无限测试时间 | 按分钟计费，另行收取报告费 |
| 真正的移动设备 | 真正的安卓手机，按需提供 | 仅模拟 |
| 测试私有环境和测试环境 | 内置安全隧道 | 无法使用 |
| 欧盟数据驻留 | 是的，符合GDPR要求 | 仅限美国地区 |
| 供应商历史记录 | 自 2012 年以来，我们一直致力于跨浏览器云服务。 | 微软的新产品 |

 ![测试结果](https://zh.testingbot.com/assets/features/test-results-315382c39a67ad52167d2a4fd78570c99aea3e0ec386c17e82265851e93cb7b3.png)

 测试工件 
## 测试结果

每项测试都可以获得生成的人工制品；屏幕截图、日志和测试的视频。

从您的测试代码中将会话标记为通过或失败，通过我们的[REST API](https://testingbot.com/support/api)获取工件，并将结果发送回 Jira、Slack 或您选择的 CI。

- 每次测试均提供全高清视频
- 专为速度和可靠性而打造
- 控制台、网络 HAR 和 Playwright 服务器日志
- 自定义屏幕分辨率、时区和语言环境
- 浏览器启动标志和[更多选项](https://testingbot.com/support/web-automate/playwright/options)

 语言与跑步者 
## 测试框架的整合

将TestingBot与Playwright和流行的测试框架相结合，如。

- ### [TypeScript / JavaScript](https://testingbot.com/support/web-automate/playwright/playwright-test)

  - [@playwright/test](https://testingbot.com/support/web-automate/playwright/playwright-test)
  - [Jest](https://testingbot.com/support/web-automate/playwright/jest)
  - [Mocha](https://testingbot.com/support/web-automate/playwright/mocha)
  - [CodeceptJS](https://testingbot.com/support/web-automate/playwright/codeceptjs)

- ### [Python](https://testingbot.com/support/web-automate/playwright/pytest)

  - [PyTest](https://testingbot.com/support/web-automate/playwright/pytest)
  - [Robot Framework](https://testingbot.com/support/web-automate/playwright/robotframework)

- ### [Java](https://testingbot.com/support/web-automate/playwright/java)

  - [Java quickstart](https://testingbot.com/support/web-automate/playwright/java)

- ### [.NET](https://testingbot.com/support/web-automate/playwright/dotnet)

  - [.NET quickstart](https://testingbot.com/support/web-automate/playwright/dotnet)

- ### [Ruby](https://testingbot.com/support/web-automate/playwright/ruby)

  - [Ruby quickstart](https://testingbot.com/support/web-automate/playwright/ruby)

- ### [Recorder & extras](https://testingbot.com/support/web-automate/playwright/recorder)

  - [Recorder](https://testingbot.com/support/web-automate/playwright/recorder)
  - [Visual regression](https://testingbot.com/support/web-automate/playwright/visual-regression-testing)
  - [Performance](https://testingbot.com/support/web-automate/playwright/performance)

使用[Playwright Recorder](https://testingbot.com/support/web-automate/playwright/recorder)来生成 Playwright 脚本，而无需编写代码。在TestingBot浏览器网格上运行记录的测试。

 大规模并行 
## 将剧作家工作室的工时从几小时缩短到几分钟

将 Playwright 工作进程分布到数百个并行运行的单用途虚拟机上。相同的测试代码，运行时间大大缩短，而且不会出现不稳定情况。

- 最多可同时进行 100 场剧作家研讨会
- 训练课几秒钟内即可开始，无需热身。
- 自动重试、智能分片和每个工作节点的工件

[免费开始](https://zh.testingbot.com/users/sign_up)

 ![将剧作家工作室的工时从几小时缩短到几分钟](https://zh.testingbot.com/assets/features/selenium/parallel-0229d698e59a8a6b92fe50344a08634624f018331ecf8a849ef83cfb35e635a5.png)

Live exit nodes
10+ countries

美国

英国

德国

法国

西班牙

比利时

澳大利亚

中国

日本

 地理位置测试 
## 测试剧作家来自 10 多个国家/地区

从世界各地的真实出口节点运行 Playwright 测试。验证来自美国、英国、德国、法国、西班牙、比利时、澳大利亚、中国、日本等地 **的地理定位** 、 **地理屏蔽** 和 **本地化功能** 。

 安全的基础设施 
## 真正的机器。一次性使用。零泄漏。

每个 Playwright 测试会话都在运行于真实操作系统上的全新、一次性虚拟机中执行。虚拟机在测试结束后立即销毁——所有数据均不会被重复使用，也不会泄露给其他客户。

符合 SOC 2 标准，符合 GDPR 标准，支持欧盟数据驻留、SAML SSO 和审计日志，可供企业团队使用。

- 一次性虚拟机，每次会话结束后都会被清除
- 符合 GDPR 标准，可提供欧盟数据驻留服务
- SAML SSO、审计日志和 SCIM 配置

[访问 TestingBot 信任中心](https://trust.testingbot.com/)

1. 1

测试连接到`cloud.testingbot.com`

只需几秒钟，即可为您创建一个全新的虚拟机，专供您使用。

2. 2

Playwright 驱动真正的浏览器

真正的 Chrome、Firefox、Edge 或 WebKit，从未模拟，从未共享。

3. 3

虚拟机在测试结束后立即销毁

Cookies、文件、浏览器状态，全部清除。所有数据都不会被重复使用。

 持续集成 
## 几分钟内即可将 Playwright 集成到您的 CI/CD 系统中

TestingBot 可与所有主流 CI/CD 工具集成。每次提交都会触发 Playwright 测试套件，并将跟踪信息、视频和日志流式传输回您的构建仪表板。

 ![Jenkins](https://zh.testingbot.com/assets/integrations/jenkins-e586a1c4af833e4c8d38d7b392a4e84bd193f30cae9cf8c9f198a58ec943a1ff.webp)

### [Jenkins](https://testingbot.com/support/integrations/ci-cd/jenkins)

 ![Bamboo](https://zh.testingbot.com/assets/integrations/bamboo-c8fe09a3cb0b74d6055e3aa6607d77720bfe29ff487b8e3cf825138adf634346.svg)

### [Bamboo](https://testingbot.com/support/integrations/ci-cd/bamboo)

 ![TeamCity](https://zh.testingbot.com/assets/integrations/teamcity-7e75cdb835903a4983ad276c41d95e569ceac5be486e96ec1f955029ce5bb319.svg)

### [TeamCity](https://testingbot.com/support/integrations/ci-cd/teamcity)

 ![CircleCI](https://zh.testingbot.com/assets/integrations/circleci-ede029654ff39b60342e4a5bba8fc9a3a49305cc38bda215b7cf8d07e85e0543.webp)

### [CircleCI](https://testingbot.com/support/integrations/ci-cd/circleci)

 ![GitLab CI](https://zh.testingbot.com/assets/integrations/gitlab-e4c0b6db07d07bc0a400f5606e258f4dc8a51b778e97bbfa51d1d531f3cb049a.webp)

### [GitLab CI](https://testingbot.com/support/integrations/ci-cd/gitlab)

 ![GitHub](https://zh.testingbot.com/assets/integrations/github-actions-8436242ad9e15381f84f1a98a10dddce15611087f121d6305782e211942b7842.webp)

### [GitHub](https://testingbot.com/support/integrations/ci-cd/github-actions)

 真机 
## 使用 Playwright 驱动真正的 Android 浏览器

无需模拟器。在我们的云端，使用真实的安卓设备，在 Chrome 浏览器上运行 Playwright 测试。同样的 Playwright API，真实的硬件，真实的传感器。

[查看可用设备](https://testingbot.com/support/web-automate/playwright/mobile)

 ![Playwright](https://zh.testingbot.com/assets/support/playwright-2dcb4e75b55ac0d1135cfa47be6137b13f46a2047ce78b96a34f51b0e2cc0d96.svg) ![Android](https://zh.testingbot.com/assets/environments/svg/android-1b3d235e17522e2238e1c55b4e9cdd41219f653cd958ea065877d3813f32ffc3.svg)

同样的Playwright API，真正的安卓Chrome浏览器。

 Secure Tunnel 
## 安全地测试内部和测试环境应用程序

使用我们的[安全隧道](https://testingbot.com/support/tunnel)，针对受防火墙保护的测试站点、内部仪表板或仍在本地主机上的应用程序运行 Playwright 测试。

端到端加密，无需入站防火墙规则，开箱即用，适用于主流 CI 提供商。

 ![TestingBot secure tunnel for Playwright](https://zh.testingbot.com/assets/features/tunnel-diagram-poster-8c25e19e6fe4f7276a46a96b31a0ad0e07bb4f5bf98dc192d2b70897cfbb1a26.png)

[阅读更多](https://zh.testingbot.com/support/tunnel)

常问问题
## 剧作家在 TestingBot 上的常见问题

为什么要在 TestingBot 上运行 Playwright 而不是在本地运行？

本地测试受限于笔记本电脑或 CI 运行器，通常只能同时运行 2-4 个浏览器，并且仅限于已安装的操作系统。TestingBot 则支持在真实的 Windows、macOS 和 Linux 机器上，使用真实的 Chrome、Firefox、Edge 和 WebKit 浏览器，同时运行多达 100 个 Playwright 并行会话，并自动收集视频和日志。

TestingBot 与 Microsoft Playwright Testing (MPT) 有何不同？

TestingBot 在真实的 Windows、macOS 和 Linux 系统上，使用 Chrome、Firefox、Edge 和 WebKit 浏览器运行 Playwright 内核。MPT 仅在 Linux 系统上运行 Chromium 内核。TestingBot 提供包含无限测试时长、真实 Android 设备和欧盟数据驻留的套餐。请参阅此页面上的[对比信息](https://zh.testingbot.com#mpt)。

TestingBot 支持哪些 Playwright 版本？

TestingBot 支持所有受支持的 Playwright 版本，包括最新版本，并在发布当天即可使用。您可以使用功能为每个测试指定特定的 Playwright 版本。

我可以并行运行 Playwright 测试吗？

是的。TestingBot 的计划包括最多 100 个并行 Playwright 会话。每个会话都在其自身的独立虚拟机中运行，因此测试之间不会相互干扰。

TestingBot 是否提供测试资源？

完整记录。每次会话均附带视频录像、屏幕截图和日志。

如何迁移我现有的 Playwright 测试？

在`playwright.config.ts`文件中将`wsEndpoint`设置为`wss://cloud.testingbot.com/playwright` ，添加您的 TestingBot 凭据，并通过 capabilities 选择浏览器、操作系统或设备。有关完整示例，请参阅我们的[迁移指南](https://testingbot.com/support/web-automate/playwright#update)。

我可以测试内部站点或测试站点吗？

是的，安装我们的[安全隧道](https://testingbot.com/support/tunnel)后，您的 Playwright 测试就可以访问暂存环境、本地主机或防火墙后的任何其他位置，无需任何入站规则。

Playwright 网格是否符合 GDPR / SOC 2 标准？

TestingBot 符合 GDPR 法规，拥有欧盟数据驻留权，并通过了 ISO 27001 标准认证和 STAR 1 级认证。我们为企业版套餐提供 SAML 单点登录 (SSO)、敏感信息安全管理 (SCIM) 和审计日志功能。

什么是剧作家？

Playwright 是微软开发的开源端到端测试框架，它通过单一 API 驱动 Chromium、Firefox 和 WebKit 浏览器。它支持 JavaScript、TypeScript、Python、Java 和 .NET，并具备自动等待、网络拦截、测试夹具和内置测试运行器等功能。团队可以使用 Playwright 进行跨浏览器测试、视觉回归测试、API 测试、辅助功能测试和移动 Web 测试。TestingBot 可在云端的真实浏览器、操作系统和 Android 设备上运行 Playwright，因此您可以轻松扩展 Playwright 测试规模，而无需管理基础设施。

Playwright是免费的吗？

是的，Playwright 本身是免费的。微软以 Apache 2.0 许可证发布它，因此您可以免费安装、编写测试并在本地运行。团队通常面临的成本问题是如何大规模地在真实浏览器、设备和并行工作线程上运行 Playwright，而 TestingBot 提供的固定费用套餐不限测试时长，正好可以满足这一需求。

Playwright是开源软件吗？

Playwright 是开源的。该框架由微软在 GitHub 上维护，采用 Apache 2.0 许可证，并拥有公开的路线图和活跃的社区。TestingBot 为该开源框架提供了一个托管的云网格，用于在真实浏览器、真实设备和并行环境下进行 Playwright 测试。

Playwright 可以用于视觉、可访问性和 API 测试吗？

是的。Playwright 是一个通用的自动化框架，因此用于端到端 UI 测试的脚本也可以用于视觉回归测试、可访问性审核、API 测试和性能检查。在 TestingBot 上，您可以获得每次会话的全高清视频、Playwright 跟踪记录、控制台和网络 HAR 日志，这使得视觉和行为对比更加容易。

## 准备好开始剧作家测试了吗？

关于如何开始，请看我们的[Playwright测试](https://testingbot.com/support/web-automate/playwright)文档。

[开始免费试用](https://zh.testingbot.com/users/sign_up)

您可能喜欢的资源

[![Visual Testing with Playwright](https://zh.testingbot.com/assets/resources/articles/14-f3f2e8954c8a47cf0bb29059b44f4d2f40998442e22db6f8acdccb8e5b34d8c1.webp)](https://testingbot.com/resources/articles/playwright-visual-regression-testing)
### [Visual Testing with Playwright](https://testingbot.com/resources/articles/playwright-visual-regression-testing)

Playwright provides automated browser testing. It offers a built-in feature to perform visual regression testing for your website.

[阅读更多](https://testingbot.com/resources/articles/playwright-visual-regression-testing)

[![Record tests with Playwright](https://zh.testingbot.com/assets/resources/articles/32-277318b88c5e35eb2c96f03d9b53a1ef8eb2d96db184679892b5008b0bad9d0f.webp)](https://testingbot.com/resources/articles/playwright-recorder)
### [Record tests with Playwright](https://testingbot.com/resources/articles/playwright-recorder)

Learn how to use a Playwright Recorder to easily record tests.

[阅读更多](https://testingbot.com/resources/articles/playwright-recorder)
