当前位置:网站首页>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
边栏推荐
- 全栈开发提效神器——ApiFox(Postman + Swagger + Mock + JMeter)
- Reasons and solutions of redis cache penetration and avalanche
- Parsing of XML
- Insert sort of sort
- "Upside down salary", "equal replacement of graduates" these phenomena show that the testing industry has
- Enterprise application business scenarios, function addition and modification of C source code
- Summary of week 22-07-02
- ORB(Oriented FAST and Rotated BRIEF)
- “薪資倒掛”、“畢業生平替” 這些現象說明測試行業已經...
- He worked as a foreign lead and paid off all the housing loans in a year
猜你喜欢
随机推荐
(脚本)一键部署redis任意版本 —— 筑梦之路
Ap8022 switching power supply small household appliances ACDC chip offline switching power supply IC
Leetcode70 (Advanced), 322
企业公司项目开发好一部分基础功能,重要的事保存到线上第一a
【C】(笔试题)指针与数组,指针
2022.07.03(LC_6109_知道秘密的人数)
Best practice case of enterprise digital transformation: introduction and reference of cloud based digital platform system security measures
leetcode494,474
Distributed base theory
[论文阅读] CarveMix: A Simple Data Augmentation Method for Brain Lesion Segmentation
Playwright之录制
NPM install error forced installation
他做国外LEAD,用了一年时间,把所有房贷都还清了
分布式BASE理论
lambda expressions
[circuit design] optocoupler use and circuit design summary
[STM32] (I) overview and GPIO introduction
Life is changeable, and the large intestine covers the small intestine. This time, I can really go home to see my daughter-in-law...
Fs8b711s14 electric wine bottle opener MCU IC scheme development special integrated IC
海思3559万能平台搭建:YUV422的踩坑记录








