当前位置:网站首页>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
边栏推荐
- Design of emergency lighting evacuation indication system for urban rail transit station
- Les phénomènes de « salaire inversé » et de « remplacement des diplômés » indiquent que l'industrie des tests a...
- Sorting selection sorting
- 7. Scala process control
- MongoDB系列之学习笔记教程汇总
- ORB(Oriented FAST and Rotated BRIEF)
- 实战模拟│JWT 登录认证
- 海思3559万能平台搭建:YUV422的踩坑记录
- 【Unity】InputSystem
- The company needs to be monitored. How do ZABBIX and Prometheus choose? That's the right choice!
猜你喜欢

Application of fire fighting system based on 3D GIS platform

Design of emergency lighting evacuation indication system for urban rail transit station

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

2022.07.03 (lc_6111_counts the number of ways to place houses)

lambda expressions

Tester's algorithm interview question - find mode

URL和URI
Date time type and format in MySQL

Fs8b711s14 electric wine bottle opener MCU IC scheme development special integrated IC

Paper notes multi UAV collaborative monolithic slam
随机推荐
Business implementation - the log is written to the same row of data
P4408 [NOI2003] 逃学的小孩(树的直径)
Basic concept and usage of redis
初识ROS
P4281 [ahoi2008] emergency assembly / gathering (LCA)
Verilog tutorial (11) initial block in Verilog
[IELTS reading] Wang Xiwei reads P4 (matching2 paragraph information matching question [difficult])
Enterprise application business scenarios, function addition and modification of C source code
Life is changeable, and the large intestine covers the small intestine. This time, I can really go home to see my daughter-in-law...
[IELTS reading] Wang Xiwei reading P4 (matching1)
华为百万聘请数据治理专家!背后的千亿市场值得关注
Is it safe to open and register new bonds? Is there any risk? Is it reliable?
Getting started with Paxos
业务场景功能的继续修改
Ruby tutorial
P4281 [AHOI2008]紧急集合 / 聚会(LCA)
NPM install error forced installation
Actual combat simulation │ JWT login authentication
MongoDB系列之学习笔记教程汇总
URL和URI