当前位置:网站首页>Playwright之录制
Playwright之录制
2022-07-05 00:38:00 【dotNET跨平台】
前言
前段时间看了大佬分享的关于Playwright.NET的文章感觉挺有意思,想要阅读点击:此处,然后跟随大佬的脚步,学习了一点自动化玩,其中有一个录制功能感觉挺好玩,下面就来简单看看
介绍
手动操作浏览器,会录制我们的操作,然后生成脚本。
操作
创建项目
--创建控制台(这点需要注意,会直接安装最新版本)
dotnet new console -n PlaywrightDemo
-- 进入目录
cd PlaywrightDemo
-- 生成项目
dotnet build
-- 添加依赖包
dotnet add package Microsoft.Playwright安装必要的浏览器(这里的netx是你当前项目的版本)
pwsh bin\Debug\netX\playwright.ps1 install
-- 示例
pwsh bin\Debug\net7.0\playwright.ps1 install开始录制
pwsh bin\Debug\netX\playwright.ps1 codegen
-- 示例
pwsh bin\Debug\net7.0\playwright.ps1 codegen然后会打开一个浏览器以及一个窗口,点击浏览器可以在另外的Playwright Inspector生成代码

注意:生成代码虽然很方便(简单的还是可以的),但是生成的内容需要仔细观察,有些是需要二次改动的。
如果你提示错误【 无法将“pwsh”项识别为 cmdlet、函数、脚本文件或可运行程序的名称】,那么你需要升级PowerShell
dotnet tool update --global PowerShell资料
文档:https://playwright.dev/dotnet/docs/intro
边栏推荐
- 测试部新来了个00后卷王,上了年纪的我真的干不过了,已经...
- Parameter passing mechanism of member methods
- OpenHarmony资源管理详解
- Identifiers and keywords
- [Yocto RM]10 - Images
- Significance of acrel EMS integrated energy efficiency platform in campus construction
- Application of multi loop instrument in base station "switching to direct"
- Operator explanation
- P3304 [SDOI2013]直径(树的直径)
- 全网最全正则实战指南,拿走不谢
猜你喜欢
Date time type and format in MySQL

业务场景功能的继续修改

企业公司项目开发好一部分基础功能,重要的事保存到线上第一a

【路径规划】RRT增加动力模型进行轨迹规划

Distributed base theory

Skills in analyzing the trend chart of London Silver

Power operation and maintenance cloud platform: open the new mode of "unattended and few people on duty" of power system

Relationship between classes and objects

IELTS examination process, what to pay attention to and how to review?

【C】 (written examination questions) pointer and array, pointer
随机推荐
两个数相互替换
测试部新来了个00后卷王,上了年纪的我真的干不过了,已经...
Hologres query management and timeout processing
Date time type and format in MySQL
[IELTS reading] Wang Xiwei reading P3 (heading)
Distributed base theory
Leetcode70 (Advanced), 322
华为200万年薪聘请数据治理专家!背后的千亿市场值得关注
2022.07.03 (lc_6111_counts the number of ways to place houses)
skimage: imread & imsave & imshow
那些一门心思研究自动化测试的人,最后都怎样了?
业务场景功能的继续修改
Hisilicon 3559 universal platform construction: YUV422 pit stepping record
leetcode518,377
What did I pay for it transfer to testing post from confusion to firmness?
Tester's algorithm interview question - find mode
Several simplified forms of lambda expression
MySQL uses the explain tool to view the execution plan
lambda表达式
Acwing164. Accessibility Statistics (topological sorting +bitset)