Chrome implements automated testing: recording and playback web page actions

Chrome browser is really horrible, it will kill related gadgets. Since its birth, it has created legends one after another. Now you can see the operating system chrome os based on it, and you can also buy laptops using it as the system.

Recently, the new version supports recording and playback functions. With this function, you can record all the operations in the browser, save them locally, and then run them repeatedly through playback.

This is really the gospel for lazy cancer patients, and they can easily bid farewell to repetitive work. Whether it is automated office, automated testing, or crawlers, it can be used.

Now let's see how to use it. First, upgrade the browser to the latest version, currently my browser version is 98, and then we enable the recording function in the developer tools.

img

After the recording function is enabled, you can view the Recorder tab in the developer tools, click the + sign or the new record button to start a new recording operation.

img

This is the official website video, you can watch:

https://player.bilibili.com/player.html?bvid=BV11L4y1v76C

When using the recording function, first click the Start Record button to start recording, and then all operations in the browser will be recorded, and after the recording is over, click End. All recorded scripts will be displayed under the Recorder tab. Click Replay to replay the previous operations. This process is automatic and does not require manual participation.

There are mainly two application scenarios in the testing process:

1. When conducting exploratory testing, you can quickly record your own test operations, which is convenient for supplementing use cases later.

2. Convert manual testing steps into automated testing codes. Currently, it supports direct export of puppeter scripts. If you don't use puppeter, you can write your own tools to convert them into codes for other tools.

It is more than enough to deal with some repetitive and messy daily tasks, such as fishing and watching news in spare time. Record a script for the operation of visiting each news website, and run this recording directly every time you want to use it. This is a video of fishing: https://player.bilibili.com/player.html?bvid=BV1aR4y157ie

Finally, I would like to thank everyone who has read my article carefully. Reciprocity is always necessary. Although it is not a very valuable thing, you can take it away if you need it:

These materials should be the most comprehensive and complete preparation warehouse for [software testing] friends. This warehouse has also accompanied tens of thousands of test engineers through the most difficult journey, and I hope it can help you! Partners can click the small card below to receive

Guess you like

Origin blog.csdn.net/kk_lzvvkpj/article/details/131463095
Recommended