UI Automation Test: UIRECORDER + Selenium Standalone Server builds Web UI Automation Test

Related document link:

1. Operation: https://www.jianshu.com/p/f7b11da864fa

Official website: http: //uirecorder.com/
Github: https://github.com/alibaba/uirecorder
User manual: https://github.com/alibaba/uirecorder/blob/master/doc/zh-cn/readme.md

Install

1. Install Java JDK and configure environment variables

2. Install nodejs

Note that the latest version released on Nodejs official website is v10.14.2, but when using the latest version of Nodejs, UI Recorder There will be problems during initialization (stuck in the Start Install project dependencies step)

Available version download link: https ://nodejs.org/dist/v8.11.3/node-v8.11.3-x64.msi

3. Install chr ome browser

4. Install UIRecorder

Use the administrator authority in the cmd window:   

 npm install -g cnpm --registry=https://registry.npm.taobao.org

  cnpm install uirecorder mocha -g

  

5. Check the browser Does it correspond to the driver version

1) Selenium’s chromedriver and chrome version mapping table (https:/ /blog.csdn.net/huilan_same/article/details/51896672)

2) C: \Users\{username}\AppData\Roaming\npm\node_modules\uirecorder\package.json

Change chromedriver to the driver version corresponding to the browser. If the chrome installed on this machine is 72.0, the corresponding driver is 2.45.0

Share a picture

< p>

  3)

cd C:\Users\xxxxx\AppData\Roaming\npm\node_modules\uirecorder

cnpm install // Update the chromedriver that uirecorder depends on to version 2.40.0

npm ls chromedriver -g // View the version of chromedriver

  

Start recording

1. Initialize the project

E:

mkdir project_name // Create a working directory

cd project_name // Enter the working directory, the following commands are executed in this working directory

uirecorder init // initialize uirecorder

  

* Enter all the way, select “Chrome” in the browser place

2. Start recording test Use case

Start uirecorder recording, and save the recorded script to sample/test.spec.js in the working directory.< /span>

uirecorder start

   At this time, two chrome browsers will be opened, one for verification and one for script recording

share picture

Playback

1. Installation And start selenium-standalone

cnpm install [emailprotected]- g
selenium-standalone install // java is required to run this
selenium-standalone start

  

2. Run playback

run.bat sample/test.spec.js

  

View the backtest report

reports\index.html< /span>

 npm install -g cnpm --registry=https://registry.npm.taobao.org

  cnpm install uirecorder mocha -g

cd C:\Users\xxxxx\AppData\Roaming\npm\node_modules\uirecorder

cnpm install // Update the chromedriver that uirecorder depends on to version 2.40.0

npm ls chromedriver -g // View the version of chromedriver

E:

mkdir project_name // Create a working directory

cd project_name // Enter the working directory, the following commands are executed in this working directory

uirecorder init // initialize uirecorder

uirecorder start

cnpm install [email protected] -g
selenium-standalone install // java is required to run this
selenium-standalone start

run.bat sample/test.spec.js

Leave a Comment

Your email address will not be published.