Web Automation Test

CukeTest provides a complete Web automation test. It provides the function of automatically generating Web automation scripts. The function of recording and replaying Web operations.

Recording Web Testing

CukeTest provides the built-in Web recording and playback function to help test developers generate automated scripts by recording web operations. These scripts can be run directly or directly integrated into existing projects as business logic operation procedures. To use. Currently, recording on Chrome (85 and above) is supported, and more types of browsers can be used for playback. This function is based on the PlayWright framework, and the detailed API can be found in the PlayWright documentation.

Create a project using a web template

CukeTest provides a Web project template, which contains simple examples, which can be run directly or added to code execution after recording. In fact, web recording can be performed in any project, and a new JavaScript file will be generated during the recording process, which can be played back directly. Here are the steps to create a project using the web recording template:

Start recording

  1. Click "New Project"
  2. Select "Web" in the template drop-down box in the project configuration dialog box
  3. Click "Record Web" button in the toolbar

It can be observed that the browser is started and the address bar is empty. Just enter the address of the website to be recorded to start the recording operation.

Specify URL recording

  1. Click "New Project"
  2. Select "Web" in the template drop-down box in the project configuration dialog box
  3. Click the drop-down button in the lower right corner of the "Web Recording" button, click "Recording Configuration", and enter the website address to be recorded in the "Start URL" item in the pop-up panel

"Recording Settings" button

  1. Click the "Start Recording" button

It can be observed that the browser is started, the address bar is the website address specified in the configuration, and the recording operation can be started directly.

Using Web Recording Function

In the above steps, a simple web recording project template was created, which can be modified directly on the basis of the template, or you can click "Record Web" button to start recording a new Web automation script. You can select "Recording Settings" from the drop-down list next to the "Record Web" button to open the dialog box and modify the default startup URL.

Recording process

After the recording starts, all actions in the open window are generated into scripts that are written to a script file. The generated scripts are also relatively simple, so if you have a basic knowledge of web automation you will quickly understand the role of each script, but if you need to understand more about the meaning of the scripts, you can check the official PlayWright documentation. During the recording process, it is not valid for the user to modify the script file being recorded, because the recording engine will modify the script according to the actions on the browser and will overwrite the user's changes, so please stop recording and then modify the recorded script code.

Playback process

After the recording is complete, you can click the "Run Script" button in the toolbar to start playback of the recorded action, or click the "Switch View" button to switch to script view only.

If the recorded script needs to be adjusted, since the recorded generated script uses the Playwright operation API, you can refer to PlayWright's API documentation for adjustment. For a video introduction of the recorded operation, watch the related contents in Introduction video.

Detectors

You can use the detector function in the toolbar to debug the Selector during the recording process. The detector will appear when entering the recording. Sniffer

The detector allows you to debug the selector during recording, which is much easier when the selector of an element is difficult to determine, or when the selector is unreliable.

Usage

The usage of the Spector is similar to that of the Inspector in the browser developer tools, with two uses.

  1. selecting an element in the page after activation gives access to the Selector, which is automatically filled into the selector input.
  2. entering the Selector in the selector input and entering will highlight the corresponding element in the page.

Develop Web Automation Scripts by Other Frameworks

In addition to the built-in web recording and playback library, CukeTest can also support users to use other open source frameworks, such as Selenium, Puppeteer, etc.

Most web automation frameworks provide JavaScript implementations. For example, Selenium provides Selenium-WebDriver for writing JavaScript scripts.

CukeTest also has built-in support for the Selenium-WebDriver framework, including the creation of Selenium-Web project templates and API smart prompts, as well as Web Automation Demo Project samples and instructions .

Chinese version click here.

results matching ""

    No results matching ""