Skip to content

UI Recorder is a UI test case recorder like Selenium IDE.

License

Notifications You must be signed in to change notification settings

HuangKBAaron/uirecorder

 
 

Repository files navigation

UI Recorder

logo.png

NPM version License NPM count NPM count

UI Recorder is a zero cost UI test case recorder like Selenium IDE.

UI Recorder is more powerful than Selenium IDE!

UI Recorder is easy to use.

  1. Official Site: http:https://uirecorder.com/
  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 recorde, powered by macaca: https://macacajs.com/
  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 mock: fake.js
  7. Support common test case: one case call another
  8. Support parallel test
  9. Support i18n: en, zh-cn, zh-tw
  10. Support screenshots after each step
  11. Support HTML report & JUnit report
  12. Support systems: windows, mac, linux
  13. Support mutli runtime test, such as: devtest, pretest
  14. Test file base on NodeJs: jWebDriver

Screenshots

shot1

shot2

shot3

shot4

Quick start

Install

  1. Install NodeJs

    https://nodejs.org/

  2. Install chrome

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

  3. Install UI Recorder

    npm install uirecorder mocha -g

PC record

  1. Init config

    uirecorder init

    npm install

  2. Start record test case

    edit hosts file

    uirecorder start sample/test.spec.js

  3. Start WebDriver Server

  4. Run test case

    source run.sh ( Linux|Mac )

    run.bat ( Windows )

  5. Get reports & screenshots

    ./reports/index.html

    ./reports/index.xml (JUnit)

    ./reports/index.json

    ./screenshots/

Mobile record

  1. Install & start macaca server:

    Install macaca: http:https://macacajs.com/

    Connect your mobile or open emulator

    macaca server --port 4444

  2. Init config

    uirecorder init --mobile

    npm install

  3. Start record test case

    uirecorder start --mobile sample/test.spec.js

  4. Run test case

    source run.sh ( Linux|Mac )

    run.bat ( Windows )

  5. Get reports & screenshots

    ./reports/index.html

    ./reports/index.xml (JUnit)

    ./reports/index.json

    ./screenshots/

QA

How to deploy WebDriver Server

  1. Selenium standalone server:

    npm install selenium-standalone -g

    selenium-standalone install

    selenium-standalone start

    or

    Download Selenium Server & IEDriverServer: http:https://selenium-release.storage.googleapis.com/index.html

    Download ChromeDriver: http:https://chromedriver.storage.googleapis.com/index.html

    Add the driver path to environment variable: PATH

    Run selenium server: java -jar selenium-server-standalone-x.xx.x.jar

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

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

How to dock Jenkins?

  1. Add commands

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

    JUnit: reports/index.xml

    HTML: reports/

How to switch runtime?

  1. export runtime=dev ( Linux|Mac ) or set runtime=dev ( Window )
  2. uirecorder init (saved to config-dev.json, hosts-dev)
  3. uirecorder start (read from config-dev.json, hosts-dev)
  4. source run.sh or run.bat (read from config-dev.json, hosts-dev)

Tip: Default runtime is used for online test, not run test case like this, ~xxx.spec.js, this file can run with dev runtime.

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 insert 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, no support for Flash
  2. <input type="file"> must place on top layer
  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:https://xxx.com/product?id={{productId}}
  2. insert vars with tool panel
  3. expect to var string: aaa{{productName}}bbb

How to use faker

You can found doc here: https://github.com/marak/Faker.js/

Can't do when recording

  1. don't change url in location bar
  2. don't change focus by TAB key
  3. don't use dblclick, WebDriver no support
  4. don't select text by mouse, WebDriver no support
  5. don't focus to background window manualy
  6. don't click useless DOM, only record key steps

How develop test friendly code?

  1. please dont't use random id or name
  2. please name a id for DOM area
  3. add label for form
  4. please listen click event instead of mousedown

How to set udid to mobile test?

  1. export devices=xxx1,xxx2 (windows: set devices=xxx1,xxx2)
  2. source run.sh ( Linux|Mac ) or run.bat ( Windows )

Other Tips

  1. Mac system: localhost must place in hosts
  2. Mac or Linux: add sudo before cmd

License

HTMLHint is released under the MIT license:

The MIT License

Copyright (c) 2016 alibaba.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Thanks

About

UI Recorder is a UI test case recorder like Selenium IDE.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.3%
  • Other 0.7%