Giter VIP home page Giter VIP logo

uirecorder's Introduction

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

Contributors


itestauipi


Stngle


yaniswang


xudafeng


undead25


stevobm


micosty


ali-lion


alibaba-oss


felizalde


portokallidis


snapre


paradite


WingOfTime


zquancai

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

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

Macaca

  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 Expect Button
  6. Click the dom you want to expect
  7. Press Esc button or click End Hover Button, exit hover mode

How to expect the value after js eval in front browser?

  1. Add Expect, select type jscode

  2. sync mode: return document.title

  3. function mode:

     function(){
         var str = "aaa";
         return str;
     }
    
  4. async mode:

     function(done){
         setTimeout(function(){
             done(123);
         }, 100);
     }
    

How to hide doms before expect?

  1. uirecorder init
  2. Input css selector when init Hide before expect
  3. uirecorder start
  4. UIRecorder will hide matched doms before expect, then you can expect the dom behind the mask div

How to record option click?

Some steps is not very important, but occasionally displayed, this steps will expect to success always.

  1. Press 'Alt' button
  2. Click the target DOM

How to use image diff?

  1. Install GraphicsMagick

    brew install graphicsmagick (Mac)

    sudo apt-get install graphicsmagick (Linux)

    http://www.graphicsmagick.org/download.html (Windows)

  2. Add expect with imgdiff

    select expect type: imgdiff

    select target element

  3. Rebuild the baseline image

    source run.sh sample/test.spec.js --rebuilddiff (Mac | Linux)

    run.bat sample/test.spec.js --rebuilddiff (Windows)

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 )

How to save raw cmds json?

  1. uirecorder start --raw
  2. After test saved, then you can get 2 files: sample/test.spec.js, sample/test.spec.json

Other Tips

  1. Mac system: localhost must place in hosts

License

UIRecorder is released under the MIT license.

Thanks

uirecorder's People

Contributors

ali-lion avatar alibaba-oss avatar felizalde avatar itestauipi avatar micosty avatar paradite avatar portokallidis avatar snapre avatar stevobm avatar stngle avatar undead25 avatar wingoftime avatar xudafeng avatar yaniswang avatar zquancai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uirecorder's Issues

多个用例嵌套执行失败

testcase1是登陆,testcase2是嵌套了testcase1(就是在刚开始就调用testcase1,这步是成功的),现在testcase3想在刚开始就调用testcase2,然后执行失败。

-------------- start load test2.spec.js --------------
url: http://localhost/?r=user/default/login
× 执行失败 TypeError: Cannot read property 'url' of undefined
waitBody:
× 执行失败 TypeError: Cannot read property 'sleep' of undefined
sendKeys: admin
× 执行失败 TypeError: Cannot read property 'sendKeys' of undefined
click: password ( #password, 83, 39, 0 )
× 执行失败 TypeError: Cannot read property 'sleep' of undefined
sendKeys: 123456
× 执行失败 TypeError: Cannot read property 'sendKeys' of undefined
click: 登 录 ( input[name="loginsubmit"], 111, 8, 0 )
× 执行失败 TypeError: Cannot read property 'sleep' of undefined
waitBody:
× 执行失败 TypeError: Cannot read property 'sleep' of undefined
mouseUp: #cm_menu li:nth-child(2) > a > div.posr, 40.5, 64, 0
× 执行失败 Wait elelment displayed timeout: 30000ms
click: #cm_menu li:nth-child(2) > a > div.posr, 40.5, 64, 0

android录制报错

uirecorder的错误信息:
手机打开失败,请检查macaca是否配置正确? Internal Server Error

macaca server的log:

responseHandler.js:54:12 [master] pid:11206 Send Error Respone to Client: get apk mainifest failed with: TypeError: Cannot read property '1' of null

InternalServerError: Internal Server Error
at Object.throw (/opt/node-v6.9.1-linux-x64/lib/node_modules/.macaca-cli_npminstall/node_modules/.1.1.2@koa/lib/context.js:91:23)
at Object.module.exports (/opt/node-v6.9.1-linux-x64/lib/node_modules/.macaca-cli_npminstall/node_modules/.1.0.68@webdriver-server/lib/server/responseHandler.js:57:17)
at throw (native)
at onRejected (/opt/node-v6.9.1-linux-x64/lib/node_modules/.macaca-cli_npminstall/node_modules/.4.6.0@co/index.js:81:24)
at process._tickCallback (internal/process/next_tick.js:103:7)

mac上ios自动化录制问题?

这个录制需要把应用先装到虚拟机上,还是需要安装包,运行的时候安装?

uirecorder start的时候的apk,app是需要安装包吗?

uirecorder mobile启动报错

uirecorder mobile启动报错
手机打开失败,请检查macaca是否配置正确? Internal Server Error

macaca终端出错
InternalServerError: Internal Server Error
at Object.module.exports.throw (C:\Users\lxiao\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\webdriver-server\node_modules\koa\lib\context.js:91:23)
at Object.module.exports (C:\Users\lxiao\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\webdriver-server\lib\server\responseHandler.js:57:17)
at throw (native)
at onRejected (C:\Users\lxiao\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\co\index.js:81:24)
at process._tickCallback (node.js:369:9)

使用多浏览器测试时,firefox时常不成功,ie非常慢

配置使用ie,chrome,firefox时,有以下问题
1.ie非常慢
2.firefox测试时有时能自动跑起来有时会报以下错误

"before all" hook

1) test.spec : firefox "before all" hook:
     Error: done() invoked with non-Error: this.getChromeWindowFromDocumentWindow(...) is undefined
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'test-PC', ip: '192.168.1.92', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_101'
Driver info: driver.version: unknown

请问这是什么问题呢?

不过重复启动几次会有一次成功。

wd.jvava 自定义 Ip、端口不生效

我这边是使用ruby来调用java的代码,用的是rjb的gem,实例化和运行都可以,但参考官方的示例ip和port的参数无法修改,提交显示仍然是http://localhost:3456wd.java里面的初始化ip和端口就可以,是否该处的java代码有bug?。直接修改写死
java代码示例:
public class SampleTest {

MacacaClient driver = new MacacaClient();

@before
public void setUp() throws Exception {
Logger logger = Logger.getLogger(getClass());
JSONObject porps = new JSONObject();
porps.put("autoAcceptAlerts", true);
porps.put("browserName", "electron");
porps.put("platformName", "desktop");
porps.put("version", "");
porps.put("javascriptEnabled", true);
porps.put("platform", "ANY");
JSONObject desiredCapabilities = new JSONObject();
desiredCapabilities.put("desiredCapabilities", porps);
//desiredCapabilities.put("host", "127.0.0.1"); // custom remote host
//desiredCapabilities.put("port", 3456); // custom remote port
driver.initDriver(desiredCapabilities).setWindowSize(1280, 800).get("https://www.baidu.com");
}

ruby代码引用:
def self.setup(hash)
if @driver.nil?
switch(hash[:deviceid])
end
params = @@device_hash[ hash[:deviceid] ]
params.each do |k,v|
ATT.keyword_logger.info( "参数 : #{k} ---> #{v.to_s}" )
end
class_json = Rjb::import('com.alibaba.fastjson.JSONObject')
porps = class_json.new
porps.put("autoAcceptAlerts",params[:autoacceptalerts])
porps.put("platformName",params[:platformname])
porps.put("platformVersion",params[:platformversion])
porps.put("deviceName",params[:devicename])
porps.put("javascriptEnable",params[:javascriptenable])
porps.put("udid",params[:udid])
porps.put("reuse",params[:reuse])
porps.put("bundleId",hash[:bundleid])
porps.put("package",hash[:package])
porps.put("activity",hash[:activity])
porps.put("browserName",hash[:browsername])
porps.put("app",hash[:app])
desiredCapabilities = class_json.new
desiredCapabilities.put("desiredCapabilities",porps)
desiredCapabilities.put("host", params[:host]) #custom
desiredCapabilities.put("port", params[:port]) #custom
ATT.keyword_logger.debug( @driver)
@driver.initDriver(desiredCapabilities)
end

交互日志提示为localhost:

org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:34
56 refused

可否将 Chrome 插件中的 z-index 值设置的大一些?

感谢提供如此好用的测试工具!
可否将 Chrome 插件中的 z-index 值设置的大一些?9999999 的 z-index 有时会小于某些 JS 弹层插件的 z-index 值,此时操作面板和 uirecorder 弹出的层就被其他 div 盖住了。
不知可不可以写一个最大的极限值?

手动定位元素的教程

您好:
由于我这边的系统较多使用了iframe嵌套,导致自动录制生成的脚本无法成功运行,查看脚本发现定位dom元素的方式比较像xpath(不太确定),请问下有定位元素的demo教程吗,我想手工修改我的脚本,去定位那些无法识别的元素,谢谢!

UI recorder 启动报错。

@yaniswang 您好,请教个问题,我在使用UIrecorder时,启动报如下错误,请问该如何处理。
nodejs版本 7.2.1
C:\Users...\AppData\Roaming\npm\node_modules\uirecorder\node_modules\promisecla
ss\lib\promiseclass.js:57
let deferred = ChainPromise.defer();
^

TypeError: ChainPromise.defer is not a function
at PromiseClass.wrapFunction [as session] (C:\Users\yhy\AppData\Roaming\npm
node_modules\uirecorder\node_modules\promiseclass\lib\promiseclass.js:57:45)
at newChromeBrowser (C:\Users\yhy\AppData\Roaming\npm\node_modules\uirecorde
r\lib\start.js:1180:12)
at onReady (C:\Users...\AppData\Roaming\npm\node_modules\uirecorder\lib\sta
rt.js:799:17)
at Server. (C:\Users\yhy\AppData\Roaming\npm\node_modules\uirecor
der\lib\start.js:1088:9)
at Server.g (events.js:292:16)
at emitNone (events.js:86:13)
at Server.emit (events.js:185:7)
at emitListeningNT (net.js:1288:10)
at _combinedTickCallback (internal/process/next_tick.js:71:11)
at process._tickCallback (internal/process/next_tick.js:98:9)

主页介绍文法错误

建议改为

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

UI Recorder is more powerful than Selenium IDE!

UI Recorder is easy to use.

使用ui recorder的问题,求帮助

使用ui recorder有几天了,这几天想多做几个用例来验证是否使用 ui recorder加入到测试小组中,并且加入到产品测试环节中去。在使用过程有以下几个问题比较纠结

  1. 录制脚本检验都成功了,但回放的时候失败(其中几个操作步骤失败)。
  2. 对原生alert支持不好,有时能检验成功有时不行。
  3. 如果使用的插件中包含iframe,检验不成功
  4. 跑用例不是很稳定,有时用例能一次跑通,有时不行(一些步骤检验不成功)

如果不稳定的话肯定是没有办法加入到产品测试环节中去的,我的想法是所有的产品必需通过自动化的回归测试。但如果自动化测试用例本身就不稳定,这肯定不行的。
针对以上问题请高手指点一下。谢谢!

如何初始化?

在视频里没有看到如何初始化呀?

我的操作步骤如下:

1). 安装uirecorder

 npm install uirecorder -g

2). 通过uirecorder init生成配置文件,配置内容如下

{
    "webdriver": {
        "host": "127.0.0.1",
        "port": "4444",
        "browsers": "chrome,ie 11"
    },
    "vars": {}
}

3). 开始运行

uirecorder start

4). 成功录制脚本

5). 运行脚本前需要webdriver环境

下载selenium
http://selenium-release.storage.googleapis.com/index.html

通过以下方式运行

java -jar selenium-server-standalone-2.53.1.jar

下载chromedriver.exe并运行
下载IEDriverServer.exe并运行

6). 运行 mocha *.spec.js

报以下错误:

 1) test.spec : chrome "before all" hook:
     Error: done() invoked with non-Error: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html
      at C:\Program Files (x86)\nodejs\node_modules\mocha\lib\runnable.js:366:21

  2) test.spec : ie 11 "before all" hook:
     Error: done() invoked with non-Error: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://selenium-release.storage.googleapis.com/index.html
      at C:\Program Files (x86)\nodejs\node_modules\mocha\lib\runnable.js:366:21

请问这问题出在什么地方?

运行 test.spec.js报错

运行 mocha test.spec.js 报错

test.spec : chrome before
C:\Users\Smart>mocha test.spec.js

test.spec : chrome
1) "before all" hook

test.spec : ie 11
2) "before all" hook

0 passing (42s)
2 failing

  1. test.spec : chrome "before all" hook:
    Error: connect ETIMEDOUT 123.57.55.5:4444
    at Object.exports._errnoException (util.js:873:11)
    at exports._exceptionWithHostPort (util.js:896:20)
    at TCPConnectWrap.afterConnect as oncomplete

  2. test.spec : ie 11 "before all" hook:
    Error: connect ETIMEDOUT 123.57.55.5:4444
    at Object.exports._errnoException (util.js:873:11)
    at exports._exceptionWithHostPort (util.js:896:20)
    at TCPConnectWrap.afterConnect as oncomplete

录制脚本回访问题

录制脚本在chrome浏览器下,执行测试脚本分别在chrome 和ie8 但是ie8浏览器由于界面的收藏栏显示导致界面的单击事件位置错误,从而使脚本无法继续,是否有此类问题的解决方案

Chrome 打开失败

Chrome打开失败!
unknown error: Chrome failed to start: crashed
(Driver info: chromedriver=2.25.426924 (649f9b868f6783ec9de71c123212b908bf3b232e),platform=Linux 4.4.0-3-deepin-amd64 x86_64)

启动uirecorder时失败,请问需要对Chrome进行哪些配置?

运行多个测试时,报错,这个是什么原因

D:\project\uirecord\test\tool.spec.js:159
browsers = browsers.replace(/^\s+|\s+$/g, '');
^

TypeError: Cannot read property 'replace' of undefined
at runThisSpec (D:\project\uirecord\test\tool.spec.js:159:24)
at Object. (D:\project\uirecord\test\tool.spec.js:143:5)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at C:\Users\lxiao\AppData\Roaming\npm\node_modules\mocha\lib\mocha.js:220:27
at Array.forEach (native)
at Mocha.loadFiles (C:\Users\lxiao\AppData\Roaming\npm\node_modules\mocha\lib\mocha.js:217:14)
at Mocha.run (C:\Users\lxiao\AppData\Roaming\npm\node_modules\mocha\lib\mocha.js:485:10)
at Object. (C:\Users\lxiao\AppData\Roaming\npm\node_modules\mocha\bin_mocha:403:18)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:968:3

自动在其他浏览器进行测试刚记录的测试文件,失败

先记录一小段测试(手动在天猫上面进行测试,自动记录),结束录制,用命令让其在其他的浏览器上自动进行测试(按照刚才的测试记录),失败了(不管是一条测试记录还是多条,0成功),跪求大神告知问题在哪儿,感激不尽!过两天就要进行测试了,出这种最基础的问题,急啊!!

提供个录制教程

目前都是手写代码,看了腾讯的优测,可以录制,期望多个录制功能和教程出来

ui Recorder 运行不起来 说打不开chrome

已经将chromedriver配置到环境变量中 启动macaca 初始化后启动不了
返回错误如下
——————

录制服务器监听在端口: 9765
Chrome打开失败!
unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9e
ed),platform=Windows NT 6.1.7601 SP1 x86_64)

多移动设备执行脚本时报错

2个移动设备在执行macha test.spec.js后,2个设备是先后安装app,然后报错,如下:
qq 20161104165221
然后也并没有执行脚本。我在官网看到的需要set devices xxx1,xxx2 不知道这个是在哪填写或者输入,多设备跑脚本时应该是怎样的步骤,求解答

win7安装报错“The Windows SDK version 8.1 was not found.”

win7安装报错:

cnpm install mocha -g

C:\Program Files\nodejs\node_modules\.uirecorder_npminstall\node_modules\.1.0.22@websocket>node "C:\Users\swj\AppData\Roaming\nvm\v4.6.1\node_modules\cnpm\node_modules\npminstall\node
-gyp-bin\\node-gyp.js" rebuild
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install th
e required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Program Files\nodej
s\node_modules\.uirecorder_npminstall\node_modules\.1.0.22@websocket\build\bufferutil.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install th
e required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Program Files\nodej
s\node_modules\.uirecorder_npminstall\node_modules\.1.0.22@websocket\build\validation.vcxproj]
deprecate [email protected][email protected][email protected][email protected] ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
√ All packages installed (131 packages installed from npm registry, use 56s, speed 516.34kB/s, json 261(1.8MB), tarball 26.52MB)
Recently updated (since 2016-10-24): 1 packages (detail see file node_modules/.recently_updates.txt)
  Today:
    → [email protected][email protected][email protected] (14:49:14)


uirecorderV2.2.18版本录制脚本问题

今天录制脚本发现生成的脚本有点问题,具体看下图,右边是录制后的原版脚本,左边是修改后能跑起来的脚本

  • 问题1:录制的点击动作,生成的脚本为mousedown方法,但是需要改成click方法才行
  • 问题2:点击链接打开新窗口后,没有生成switchWindow方法

链接地址:https://www.zhihu.com/roundtable/wintersports
具体操作为:打开链接地址,点击第一条问题会打开新窗口,然后关闭打开的新窗口,结束录制

请大神确认下是不是版本更新导致uirecorder的录制有点问题,因为之前的版本我可以操作很复杂的步骤,生成的脚本基本不用修改

IEDriverServer启动不成功

我的环境如下:
操作系统:win7_64
浏览器:ie8
selenium-server-standalone-2.53.1
IEDriverServer_x64_2.53.1

服务执行命令为:java -jar selenium-server-standalone-2.53.1.jar -Dwebdriver.ie.driver=IEDriverServer.exe

测试用户运行报错:
test.spec : ie 8
1) "before all" hook

0 passing (20s)
1 failing

  1. test.spec : ie 8 "before all" hook:
    Error: done() invoked with non-Error: {"message":null,"suppressed":[],"loca
    lizedMessage":null,"cause":null,"class":"java.util.concurrent.TimeoutException",
    "hCode":477370813,"stackTrace":[{"fileName":null,"class":"java.lang.StackTraceEl
    ement","lineNumber":-1,"className":"java.util.concurrent.FutureTask","nativeMeth
    od":false,"methodName":"get","hCode":413889654},{"fileName":"SimpleTimeLimiter.j
    ava","class":"java.lang.StackTraceElement","lineNumber":130,"className":"com.goo
    gle.common.util.concurrent.SimpleTimeLimiter","nativeMethod":false,"methodName":
    "callWithTimeout","hCode":-2004172171},{"fileName":"UrlChecker.java","class":"ja
    va.lang.StackTraceElement","lineNumber":80,"className":"org.openqa.selenium.net.
    UrlChecker","nativeMethod":false,"methodName":"waitUntilAvailable","hCode":-7423
    18711},{"fileName":"DriverService.java","class":"java.lang.StackTraceElement","l
    ineNumber":175,"className":"org.openqa.selenium.remote.service.DriverService","n
    ativeMethod":false,"methodName":"waitUntilAvailable","hCode":-451304678},{"fileN
    ame":"DriverService.java","class":"java.lang.StackTraceElement","lineNumber":166
    ,"className":"org.openqa.selenium.remote.service.DriverService","nativeMethod":f
    alse,"methodName":"start","hCode":-1827402477},{"fileName":"DriverCommandExecuto
    r.java","class":"java.lang.StackTraceElement","lineNumber":78,"className":"org.o
    penqa.selenium.remote.service.DriverCommandExecutor","nativeMethod":false,"metho
    dName":"execute","hCode":-633333586},{"fileName":"RemoteWebDriver.java","class":
    "java.lang.StackTraceElement","lineNumber":644,"className":"org.openqa.selenium.
    remote.RemoteWebDriver","nativeMethod":false,"methodName":"execute","hCode":1767
    885131},{"fileName":"RemoteWebDriver.java","class":"java.lang.StackTraceElement"
    ,"lineNumber":249,"className":"org.openqa.selenium.remote.RemoteWebDriver","nati
    veMethod":false,"methodName":"startSession","hCode":-1182648225},{"fileName":"Re
    moteWebDriver.java","class":"java.lang.StackTraceElement","lineNumber":234,"clas
    sName":"org.openqa.selenium.remote.RemoteWebDriver","nativeMethod":false,"method
    Name":"startSession","hCode":-1182648240},{"fileName":"InternetExplorerDriver.ja
    va","class":"java.lang.StackTraceElement","lineNumber":182,"className":"org.open
    qa.selenium.ie.InternetExplorerDriver","nativeMethod":false,"methodName":"run","
    hCode":-1132542939},{"fileName":"InternetExplorerDriver.java","class":"java.lang
    .StackTraceElement","lineNumber":174,"className":"org.openqa.selenium.ie.Interne
    tExplorerDriver","nativeMethod":false,"methodName":"","hCode":-2098680252}
    ,{"fileName":"InternetExplorerDriver.java","class":"java.lang.StackTraceElement"
    ,"lineNumber":150,"className":"org.openqa.selenium.ie.InternetExplorerDriver","n
    ativeMethod":false,"methodName":"","hCode":-2098680276},{"fileName":null,"
    class":"java.lang.StackTraceElement","lineNumber":-2,"className":"sun.reflect.Na
    tiveConstructorAccessorImpl","nativeMethod":true,"methodName":"newInstance0","hC
    ode":513928194},{"fileName":null,"class":"java.lang.StackTraceElement","lineNumb
    er":-1,"className":"sun.reflect.NativeConstructorAccessorImpl","nativeMethod":fa
    lse,"methodName":"newInstance","hCode":-432498851},{"fileName":null,"class":"jav
    a.lang.StackTraceElement","lineNumber":-1,"className":"sun.reflect.DelegatingCon
    structorAccessorImpl","nativeMethod":false,"methodName":"newInstance","hCode":-2
    147429624},{"fileName":null,"class":"java.lang.StackTraceElement","lineNumber":-
    1,"className":"java.lang.reflect.Constructor","nativeMethod":false,"methodName":
    "newInstance","hCode":-1851634561},{"fileName":"DefaultDriverProvider.java","cla
    ss":"java.lang.StackTraceElement","lineNumber":103,"className":"org.openqa.selen
    ium.remote.server.DefaultDriverProvider","nativeMethod":false,"methodName":"call
    Constructor","hCode":-2096353668},{"fileName":"DefaultDriverProvider.java","clas
    s":"java.lang.StackTraceElement","lineNumber":97,"className":"org.openqa.seleniu
    m.remote.server.DefaultDriverProvider","nativeMethod":false,"methodName":"newIns
    tance","hCode":1201680335},{"fileName":"DefaultDriverFactory.java","class":"java
    .lang.StackTraceElement","lineNumber":60,"className":"org.openqa.selenium.remote
    .server.DefaultDriverFactory","nativeMethod":false,"methodName":"newInstance","h
    Code":-1365021416},{"fileName":"DefaultSession.java","class":"java.lang.StackTra
    ceElement","lineNumber":222,"className":"org.openqa.selenium.remote.server.Defau
    ltSession$BrowserCreator","nativeMethod":false,"methodName":"call","hCode":20561
    68471},{"fileName":"DefaultSession.java","class":"java.lang.StackTraceElement","
    lineNumber":1,"className":"org.openqa.selenium.remote.server.DefaultSession$Brow
    serCreator","nativeMethod":false,"methodName":"call","hCode":2056168250},{"fileN
    ame":null,"class":"java.lang.StackTraceElement","lineNumber":-1,"className":"jav
    a.util.concurrent.FutureTask","nativeMethod":false,"methodName":"run","hCode":42
    4519275},{"fileName":"DefaultSession.java","class":"java.lang.StackTraceElement"
    ,"lineNumber":176,"className":"org.openqa.selenium.remote.server.DefaultSession$
    1","nativeMethod":false,"methodName":"run","hCode":-255143467},{"fileName":null,
    "class":"java.lang.StackTraceElement","lineNumber":-1,"className":"java.util.con
    current.ThreadPoolExecutor","nativeMethod":false,"methodName":"runWorker","hCode
    ":-1208971944},{"fileName":null,"class":"java.lang.StackTraceElement","lineNumbe
    r":-1,"className":"java.util.concurrent.ThreadPoolExecutor$Worker","nativeMethod
    ":false,"methodName":"run","hCode":-166011880},{"fileName":null,"class":"java.la
    ng.StackTraceElement","lineNumber":-1,"className":"java.lang.Thread","nativeMeth
    od":false,"methodName":"run","hCode":1432591020}],"screen":null}
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules\mocha\lib\runna
    ble.js:363:23
    at process._tickCallback (internal/process/next_tick.js:103:7)

多个测试脚本如何执行

我将多个测试脚本放到test文件夹下 执行mocha ,在第二个文件报错,如果只有一个测试脚本文件是正常的,请问如何处理,报错信息如下:

D:\00test\01uirecorder\test\SY_002.js:48
browsers = browsers.replace(/^\s+|\s+$/g, '');
^

TypeError: Cannot read property 'replace' of undefined
at runThisSpec (D:\00test\01uirecorder\test\SY_002.js:48:24)
at Object. (D:\00test\01uirecorder\test\SY_002.js:32:5)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at C:\Users\Dongyuhua\AppData\Roaming\npm\node_modules\mocha\lib\mocha.js:220:27
at Array.forEach (native)
at Mocha.loadFiles (C:\Users\Dongyuhua\AppData\Roaming\npm\node_modules\mocha\lib\mocha.js:217:14)
at Mocha.run (C:\Users\Dongyuhua\AppData\Roaming\npm\node_modules\mocha\lib\mocha.js:485:10)
at Object. (C:\Users\Dongyuhua\AppData\Roaming\npm\node_modules\mocha\bin_mocha:403:18)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)

windows 7 运行失败

录制脚本成功,但是运行到IE的时候失败
test.spec : chrome
√ url: http://XXXXXXXX/index.html (1816ms)
√ waitBody: (574ms)
√ click: input[type="text"], 81, 25, 0 (692ms)
√ sendKeys: 13700864141{TAB}123456
√ click: #check, 7, 6, 0 (708ms)
√ click: XX ( input.login, 144, 24, 0 ) (700ms)
√ click: XXXXXX ( #side-menu li.kcb > ul.nav-second-level > li:nth-ch
ild(1) > a, 54, 14, 0 ) (711ms)
√ click: XXXXXX ( #side-menu li.kcb > ul.nav-second-level > li:nth-child(
2) > a, 32, 16, 0 ) (700ms)
√ click: XXXXXXX ( #side-menu li.kcb > ul.nav-second-level > li:nth-ch
ild(3) > a, 48, 15, 0 ) (691ms)
√ click: XXXXXXX ( #side-menu ul.nav-second-level > li:nth-child(4) > a, 4
0, 13, 0 ) (685ms)

test.spec : ie11
1) "before all" hook

10 passing (11s)
1 failing

  1. test.spec : ie11 "before all" hook:
    Error: done() invoked with non-Error: The best matching driver provider org
    .openqa.selenium.ie.InternetExplorerDriver can't create a new driver instance fo
    r Capabilities [{ie.ensureCleanSession=true, hosts=, browserName=ie11, platform=
    ANY}]
    Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
    System info: host: 'PC-20151125WOSC', ip: '192.168.56.1', os.name: 'Windows 7',
    os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_92'
    Driver info: driver.version: unknown
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules\mocha\lib\runna
    ble.js:366:21
    at process._tickCallback (internal/process/next_tick.js:103:7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.