当前位置: 首页 > 工具软件 > UI Recorder > 使用案例 >

uirecorder 自动化测试/升级chromedriver

孟树
2023-12-01

官方 chromedriver:
https://chromedriver.chromium.org/downloads

UI Recorder 是一款面向多端的 UI 自动化录制工具,类似于Selenium IDE 但比Selenium IDE 更加强大!
UI Recorder 非常简单易用,零成本解决测试回归问题。
官方网站: https://www.yuque.com/artist/uirecorder
https://github.com/alibaba/uirecorder/blob/master/README_zh-cn.md

  1. 安装 NodeJs (版本号 >= v7.x)
    https://nodejs.org/

  2. 安装 chrome
    https://www.google.com/chrome/

  3. 安装 UI Recorder
    npm install uirecorder mocha macaca-reporter -g

  4. 安装 Java :注意不要安装java最高版本
    https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

window 10

mkdir uirecorder_test
cd uirecorder_test
#初始化测试工程安装chrome,ie等浏览器驱动,
uirecorder init
输出log如下所示:安装了selenium-standalone来启动webserver,并且安装chrome驱动chromedriver/98.0.4758.102。
此时我的chrome自动升级已是最新版本 100.0.4896.60(正式版本) (64 位)
录制测试脚本,回归测试失败!

selenium-standalone installation starting
selenium install:
from: http://npm.taobao.org/mirrors/selenium/3.141/selenium-server-standalone-3.141.59.jar

to: C:\Users\icqian\Documents\uirecorder_test\node_modules\_selenium-standalone@6.24.0@selenium-standalone\.selenium\selenium-server\3.141.59-server.jar
---
chrome install:
from: http://npm.taobao.org/mirrors/chromedriver/98.0.4758.102/chromedriver_win32.zip
to: C:\Users\icqian\Documents\uirecorder_test\node_modules\_selenium-standalone@6.24.0@selenium-standalone\.selenium\chromedriver\latest-x64-chromedriver
---
ie install:
from: http://npm.taobao.org/mirrors/selenium/3.150/IEDriverServer_x64_3.150.1.zip
to: C:\Users\icqian\Documents\uirecorder_test\node_modules\_selenium-standalone@6.24.0@selenium-standalone\.selenium\iedriver\3.150.1-x64-IEDriverServer.exe
---
firefox install:
from: http://npm.taobao.org/mirrors/geckodriver/v0.30.0/geckodriver-v0.30.0-win64.zip
to: C:\Users\icqian\Documents\uirecorder_test\node_modules\_selenium-standalone@6.24.0@selenium-standalone\.selenium\geckodriver\latest-x64-geckodriver
---
edge install:
from: https://download.microsoft.com/download/F/8/A/F8AF50AB-3C3A-4BC4-8773-DC27B32988DD/MicrosoftWebDriver.exe
to: C:\Users\icqian\Documents\uirecorder_test\node_modules\_selenium-standalone@6.24.0@selenium-standalone\.selenium\edgedriver\17134-MicrosoftEdgeDriver.exe
---
chromiumedge install:
from: https://msedgedriver.azureedge.net/100.0.1185.29/edgedriver_win64.zip
to: C:\Users\icqian\Documents\uirecorder_test\node_modules\_selenium-standalone@6.24.0@selenium-standalone\.selenium\chromiumedgedriver\latest-x64-msedgedriver
window录制脚本和启动webserver回归测试
npm run server # win+R 打开另一个dos终端运行 

uirecorder test.js
# 录制浏览器窗口最大尺寸:maximize
run.bat test.js

ERROR: “before all” hook:
Error: the string "session not created: This version of ChromeDriver only supports Chrome version 98\nCurrent browser version is 100.0.4896.60 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe\n

chrome install:
from: http://npm.taobao.org/mirrors/chromedriver/98.0.4758.102/chromedriver_win32.zip
to: C:\Users\icqian\Documents\uirecorder_test\node_modules\_selenium-standalone@6.24.0@selenium-standalone\.selenium\chromedriver\latest-x64-chromedriver

尝试修改uirecorder的chromedriver和package.json,重下uirecorder等方法 但都没有生效。
最后删掉了_selenium-standalone文件夹:C:\Users\icqian\Documents\uirecorder_test\node_modules\_selenium-standalone@6.24.0@selenium-standalone

1、重新安装selenium-standlone
npm install selenium-standalone@latest -g  

2、安装 chrome、ie、firefox、edge对应的driver
selenium-standalone install 

3、启动WebDriver服务
selenium-standalone start

4、顺利运行chrome 100
run.bat test.js


 类似资料: