Introduction to the super powerful automated recording tool for automated testing

"  Introduction to the automatic testing tool-uirecorder environment setup "

01—Contents

1 Introduction

2. Matters needing attention

3. Introduction

4. Environment setup

5. Focus on the installation of nodejs.

6. Create a project: record web page

7. Extension: recording app

 

02—Notes

1. Try not to have Chinese in the name of the folder (also Japanese!);

2. Try not to have spaces in the name of the folder;

3. Especially jdk and nodejs, they are very picky~;

 

03—Introduction

 

Support all user behaviors: keyboard events, mouse events, vigilance, file upload, drag and drop, svg shadow dom

• Support wireless local application (Android, iOS) recording, based on Macaca implementation: https://macacajs.com/

• Interference-free recording: No difference from normal testing, without any interaction

• Recording cases are stored locally

• Support rich assertion types: val, text, display, enable, select, attr, css, url, title, cookie, sessionStoragelocalStorage,

• Support picture comparison

• Support for powerful variable strings

• Support public test cases: allow one to be dynamically called in the use case

• Support concurrent testing

• Support multiple languages: English, Simplified Chinese, Traditional Chinese • Support single-step screenshots

•Support HTML report and JUnit report

• Full system support: Windows, Mac, Linux • Nodejs-based test case: jWebDriver

 

04—Environment Construction

•JDK, and configure environment variables

•nodejs

• Install goole and the corresponding driver. chromedriver.exe is placed in the c:windows/system32 directory and the python installation directory, otherwise an error will be reported. Note that the version must correspond, 69 and 2.3••

• Install cnpm: npm install -g cnpm •

• Install uirecorder: cnpminstall uirecorder mocha -g•

• Installation dependency: cnpminstall jwebdriver expect.js mocha-generators faker --save-dev •

• Related installation tutorial: https://www.cnblogs.com/igubai/p/7593285.html

 

05—nodejs installation

• After nodejs installation is complete,

• Need to add two folders [node_global] and [node_cache] under the root directory,

•Check if the installation is successful: node -v, npm -v

• The configuration is the path of the global module installed by npm and the path of the cache

•npmconfig set prefix "D:\Develop\nodejs\node_global"

•Npmconfig set cache "D:\Develop\nodejs\node_cache"•Add environment variables:

• Create a new [NODE_PATH] under [System Variables] and enter [root directory\node_global\node_modules]

• Modify the path of npm under [Path] under [User Variables] to [Root Directory\node_global]

•Npmconfig set registry https://registry.npm.taobao.org #Switch installation mirror address•

• If you use npm -v to report an error and modify the .npmrc file in the user's root directory, you may have made an error when setting the installation path.

 

06—Create a use case

Create a project operation:

  1. Create a new folder to store all dependent files.

  2. Initialize this folder: uirecorder init

  3. Start recording: uirecorder + script storage location, such as: uirecorder sample/test.spec.js

  4. After finishing recording, if you want to continue recording, just use the record command again.

  5. Run the script: run.bat + script file path, if an error is reported when running, modify the script: {$sizeCode} This replacement is replaced with .maximize()

  6. Obtain the test report and the screenshot of the single-step operation, in the report folder under the newly created file.

 

 

07---Extension: recording app

Install macaca operating environment:

  1. Macaca core installation: a monkey appears on the npmimacaca-cli -g interface, indicating that the installation is successful.

  2. SDK, configure andriod_home environment variable

  3. Check the environment: macaca doctor

  4. Install the driver: npm i macaca-android -g for Android

  5. Install two apps (pictured):

  6. Install gradle, in the file

Have been downloaded, copy directly to the required path

Just download and add environment variables.

  7. Add [GRADLE_HOME] in [System Variables] C:\Gradle\gradle-4.6 (your gradle root directory)

Add [path]%GRADLE_HOME%\bin; (the bin folder under your gradle decompression directory) in [System Variables] to verify, cmd command line window: gradle-v, just display the version number.

 

08—Recording app continued

1. Install app_inspector: npmiapp-inspector -g

2. Link mobile phone or simulator, find device: adb devices

3. The command to start app-inspector: app-inspector-u device id, a message appears, indicating that the installation is successful.

4. If there is an error in installing the app, install it manually, the two apps under this file

When an error is reported when installing macaca-cil, use the command: npm i gulp-uglify -g

 

09—Recording app continued

Start recording:

  1. Connect your phone or emulator

  2. Start the service: macaca server --port 4444

  3. Create a new folder

  4. Initialization file: uirecorder init --mobile

  5. Start recording test cases: uirecorder --mobile sample/test.spec.js

  6. Continue recording: uirecorder --mobile sample/test.spec.js

  7. Run the test case: run.bat sample/test.spec.js

  8. View the test report: under report under the created folder.

I have prepared a few websites for you to learn from, you can check it out!

Related websites

https://github.com/alibaba/uirecorder/blob/master/README_zh-cn.md

https://testerhome.com/topics/12277

https://www.cnblogs.com/igubai/p/7593285.html

 

 

Wonderful review of past issues:

The New Year is coming soon. The full screen of the New Year’s greeting pop-up window is amazing and joyful. Even if the computer crashes, it is still happy-the New Year’s greeting pop-up window, find out.

How to automatically send text messages to girlfriends ,

Python teaches you to automatically add friends

 

 

Reply to uirecorder in the background to  obtain a collection of relevant information.

To learn more, please pay attention to the official account:

 

Guess you like

Origin blog.csdn.net/qq_39046854/article/details/85892865