SkillAgentSearch skills...

Uirecorder

UI Recorder is a multi-platform UI test recorder.

Install / Use

/learn @alibaba/Uirecorder
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

UI Recorder


logo.png

NPM version License NPM count NPM count TesterHome

UI Recorder is multi-platform UI test case recorder like Selenium IDE but more powerful than Selenium IDE!

UI Recorder is easy to use, even zero cost.

  1. Official Site: https://www.yuque.com/artist/uirecorder/
  2. Language Switch: English, 中文
  3. Change log: CHANGE
  4. Video Tutorial:PC中文教程

Features

  1. Support all user operation: key event, mouse event, alert, file upload, drag, svg, shadow dom
  2. Support mobile native APP(Android, iOS) recorde, powered by Macaca
  3. No interference when recording: the same as self test
  4. Record test file saved in local
  5. Support kinds of expect: val,text,displayed,enabled,selected,attr,css,url,title,cookie,localStorage,sessionStorage
  6. Support image diff
  7. Support powerful var string
  8. Support common test case: one case call another
  9. Support parallel test
  10. Support i18n: en, zh-cn, zh-tw
  11. Support screenshots after each step
  12. Support HTML report & JUnit report
  13. Support multi systems: Windows, Mac, Linux
  14. Test file base on NodeJs: jWebDriver
<!-- GITCONTRIBUTOR_START -->

Contributors

|<img src="https://avatars.githubusercontent.com/u/62272417?v=4" width="100px;"/><br/><sub><b>itestauipi</b></sub><br/>|<img src="https://avatars.githubusercontent.com/u/18617837?v=4" width="100px;"/><br/><sub><b>Stngle</b></sub><br/>|<img src="https://avatars.githubusercontent.com/u/970390?v=4" width="100px;"/><br/><sub><b>yaniswang</b></sub><br/>|<img src="https://avatars.githubusercontent.com/u/1011681?v=4" width="100px;"/><br/><sub><b>xudafeng</b></sub><br/>|<img src="https://avatars.githubusercontent.com/u/7446962?v=4" width="100px;"/><br/><sub><b>undead25</b></sub><br/>|<img src="https://avatars.githubusercontent.com/u/5198256?v=4" width="100px;"/><br/><sub><b>stevobm</b></sub><br/>| | :---: | :---: | :---: | :---: | :---: | :---: | |<img src="https://avatars.githubusercontent.com/u/8197272?v=4" width="100px;"/><br/><sub><b>micosty</b></sub><br/>|<img src="https://avatars.githubusercontent.com/u/73584840?v=4" width="100px;"/><br/><sub><b>ali-lion</b></sub><br/>|<img src="https://avatars.githubusercontent.com/u/13583768?v=4" width="100px;"/><br/><sub><b>alibaba-oss</b></sub><br/>|<img src="https://avatars.githubusercontent.com/u/14184989?v=4" width="100px;"/><br/><sub><b>felizalde</b></sub><br/>|<img src="https://avatars.githubusercontent.com/u/977025?v=4" width="100px;"/><br/><sub><b>portokallidis</b></sub><br/>|<img src="https://avatars.githubusercontent.com/u/52845048?v=4" width="100px;"/><br/><sub><b>snapre</b></sub><br/>| <img src="https://avatars.githubusercontent.com/u/1209810?v=4" width="100px;"/><br/><sub><b>paradite</b></sub><br/>|<img src="https://avatars.githubusercontent.com/u/24625264?v=4" width="100px;"/><br/><sub><b>WingOfTime</b></sub><br/>|<img src="https://avatars.githubusercontent.com/u/8609783?v=4" width="100px;"/><br/><sub><b>zquancai</b></sub><br/>

This project follows the git-contributor spec, auto updated at Sat Apr 30 2022 21:11:26 GMT+0800.

<!-- GITCONTRIBUTOR_END -->

Screenshots

shot1

shot2

shot3

shot4

Video demo

video1

video2

Quick start

Install

  1. Install NodeJs (version >= v7.x)

    https://nodejs.org/

    sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share} (Mac, Linux)

  2. Install chrome

    https://www.google.com/chrome/

  3. Install UI Recorder

    npm install uirecorder mocha -g

PC record

  1. Init test project

    Create new folder

    uirecorder init

  2. Start record test case

    edit hosts file

    uirecorder sample/test.spec.js

  3. Start WebDriver Server

  4. Run test case

    Run all case: source run.sh ( Linux|Mac ) or run.bat ( Windows )

    Run single case: source run.sh sample/test.spec.js ( Linux|Mac ) or run.bat sample/test.spec.js ( Windows )

  5. Get reports & screenshots

    ./reports/index.html

    ./reports/index.xml (JUnit)

    ./reports/index.json

    ./screenshots/

More Platform Support

<p align="center"> <a href="//macacajs.github.io"> <img alt="Macaca" src="https://macacajs.github.io/logo/macaca.svg" width="200" /> </a> </p>
  1. Install & start macaca server:

    Install Macaca

    Connect your mobile or open emulator

    macaca server --port 4444

  2. Init test project

    Create new folder

    uirecorder init --mobile

  3. Start record test case

    uirecorder --mobile sample/test.spec.js

  4. Run test case

    Run all case: source run.sh ( Linux|Mac ) or run.bat ( Windows )

    Run single case: source run.sh sample/test.spec.js ( Linux|Mac ) or run.bat sample/test.spec.js ( Windows )

  5. Get reports & screenshots

    ./reports/index.html

    ./reports/index.xml (JUnit)

    ./reports/index.json

    ./screenshots/

Documentation Translations

  1. 中文使用手册

QA

How to debug test code

  1. Install Visual Studio Code & open Visual Studio Code
  2. Open the project root folder by vs code
  3. Open test file, add break point
  4. press F5 key to start, press F10 key to run next line

How to deploy WebDriver Server

  1. How to run selenium standalone server?

    npm run server

  2. Selenium Grid: https://github.com/SeleniumHQ/selenium/wiki/Grid2

  3. F2etest: https://github.com/alibaba/f2etest

How to change webdriver host & port by env temporary, debug for local?

  1. export webdriver=127.0.0.1:4444 or set webdriver=127.0.0.1:4444 (Windows)

Tip: port is not required, For example: export webdriver=127.0.0.1

How to dock Jenkins?

  1. Add commands

     source ./install.sh
     source ./run.sh
    
  2. Add reports

    JUnit: reports/index.xml

    HTML: reports/index.html

How to filter unstable path

  1. Because some attribute values are random or unstable, we can't record a stable CSS selector
  2. We can filter the attributes with a blacklist. You can type uirecorder init and then input the blacklist from the command line

Tip: blacklist is a regex, you can use it like this: /attr_\d+/

How to record common test case?

  1. Record commons/login.mod.js

  2. Record sample/test.spec.js

    1. please input login.mod.js in recorder start page or jump test case in page
    2. After login.mod.js loaded, then recorder other steps
  3. source run.sh ( Linux|Mac ) or run.bat ( Windows )

How to record file upload?

  1. UI Recorder only support native file compont
  2. direct click <input type="file"> or click <button role="upload">Upload file</button>, the placeholder button must mark as upload with role or data-role
  3. File must save to uploadfiles/ directory

How to use vars

edit config.json

{
    "recorder": {
        ...
    },
    "webdriver": {
        ...
    },
    "vars": {
        "productId": "123456",
        "productName": "mp3"
    }
}
  1. start with url: http://xxx.com/product?id={{productId}}
  2. add new var with tool panel
  3. update var with tool panel
  4. jump url with tool panel: http://xxx.com/product?id={{productId}}
  5. insert vars string with tool panel: {{productName}} or aaa{{productName}}bbb
  6. expect to var string: {{productName}} or aaa{{productName}}bbb

Tip: All var string also support js template string, For example: {{productName}}, ${new Date().getTime()}, ${parseInt(testVars.a)+parseInt(testVars.b)}

How to add hover multiple or add expect after a hover?

  1. Press down Ctrl or Command button
  2. Click Add Hover Button, enter hover mode
  3. Release Ctrl or Command button
  4. Click the dom you want to hover (can add multiple)
  5. Click `Add E
View on GitHub
GitHub Stars2.1k
CategoryDevelopment
Updated13h ago
Forks393

Languages

JavaScript

Security Score

100/100

Audited on Mar 28, 2026

No findings