Hướng dẫn playwright codegen python
Playwright comes with the ability to generate tests out of the box and is a great way to quickly get started with testing. It will open two windows, a browser window where you interact with the website you wish to test and the Playwright Inspector window where you can record your tests, copy the tests, clear your tests as well as change the language of your tests. Show Running Codegen
Run Emulate viewport sizePlaywright opens a browser window with it's viewport set to a specific width and height and is not
responsive as tests need to be run under the same conditions. Use the
Emulate devicesRecord scripts and tests while emulating a mobile device using the
Emulate color schemeRecord scripts and tests while emulating the color scheme with the
Emulate geolocation, language and timezoneRecord
scripts and tests while emulating timezone, language & location using the
Preserve authenticated stateRun After performing authentication and closing the browser,
Run with
Use the
Record using custom setupIf you would like to use codegen in some non-standard setup (for example, use browser_context.route(url, handler, **kwargs)), it is possible to call page.pause() that will open a separate window with codegen controls.
|