当前位置:网站首页>Playwright recording
Playwright recording
2022-07-05 00:48:00 【Dotnet cross platform】
Preface
Some time ago, I saw what the boss shared about Playwright.NET The article feels very interesting , Want to read Click : here , Then follow the steps of the boss , Learned a little Automation play , One of the recording functions feels very interesting , Now let's have a brief look
Introduce
Manually operate the browser , Will record our operation , And then generate the script .
operation
Create project
-- Create a console ( This is something to be aware of , The latest version will be installed directly )
dotnet new console -n PlaywrightDemo
-- Entry directory
cd PlaywrightDemo
-- Generating project
dotnet build
-- Add dependency package
dotnet add package Microsoft.PlaywrightInstall the necessary browser ( there netx Is the version of your current project )
pwsh bin\Debug\netX\playwright.ps1 install
-- Example
pwsh bin\Debug\net7.0\playwright.ps1 installStart recording
pwsh bin\Debug\netX\playwright.ps1 codegen
-- Example
pwsh bin\Debug\net7.0\playwright.ps1 codegenThen a browser and a window will open , Click on the browser to view another Playwright Inspector The generated code

Be careful : Although it is convenient to generate code ( Simple or ok ), But the generated content needs careful observation , Some need secondary changes .
If you prompt an error 【 Cannot be “pwsh” Item identified as cmdlet、 function 、 The name of the script file or runnable program 】, So you need to upgrade PowerShell
dotnet tool update --global PowerShellInformation
file :https://playwright.dev/dotnet/docs/intro
边栏推荐
- Distributed base theory
- Two numbers replace each other
- SAP UI5 应用开发教程之一百零七 - SAP UI5 OverflowToolbar 容器控件介绍的试读版
- 多模输入事件分发机制详解
- ||Interview questions you will encounter
- 实战模拟│JWT 登录认证
- ORB(Oriented FAST and Rotated BRIEF)
- Basic concept and usage of redis
- [Yocto RM]11 - Features
- Parameter passing mechanism of member methods
猜你喜欢

Two numbers replace each other

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

Leetcode70 (Advanced), 322

He worked as a foreign lead and paid off all the housing loans in a year

【Unity】InputSystem

Reasons and solutions of redis cache penetration and avalanche

A new method for analyzing the trend chart of London Silver

Learn C language from scratch day 024

User login function: simple but difficult

2022.07.03(LC_6111_统计放置房子的方式数)
随机推荐
挖财学院开户安全的吗?开户怎么开?
P3304 [SDOI2013]直径(树的直径)
[Yocto RM]10 - Images
IT转测试岗,从迷茫到坚定我究竟付出了什么?
Visual explanation of Newton iteration method
Verilog tutorial (11) initial block in Verilog
ORB(Oriented FAST and Rotated BRIEF)
TS快速入门-函数
It's too convenient. You can complete the code release and approval by nailing it!
Is it safe to open an account in the College of Finance and economics? How to open an account?
Upload avatar on uniapp
7. Scala process control
Hologres Query管理及超时处理
(script) one click deployment of any version of redis - the way to build a dream
企业公司项目开发好一部分基础功能,重要的事保存到线上第一a
abc 258 G - Triangle(bitset)
const、volatile和restrict的作用和用法总结
pycharm专业版下载安装教程
Netcore3.1 JSON web token Middleware
Best practice case of enterprise digital transformation: introduction and reference of cloud based digital platform system security measures