您的位置:首页技术文章
文章详情页

node.js - 前端测试(UI Recorder)webdriver启动firefox报错

【字号: 日期:2023-10-08 10:41:29浏览:39作者:猪猪

问题描述

刚接触前端自动化测试,研究了下Selenium和Macaca,然后发现了阿里的UI Recorder,chrome和ie下载了对应的webdriver,运行成功,只有firefox失败。找了半天说是没有安装到默认路径,网上的解决方案是java的,这种情况该怎么配置?

15:28:38.967 INFO - Executing: [new session: Capabilities [{ie.ensureCleanSession=true, hosts=, browserName=firefox, platform=ANY}]])15:28:38.969 INFO - Creating a new session for Capabilities [{ie.ensureCleanSession=true, hosts=, browserName=firefox, platform=ANY}]15:28:38.970 WARN - Exception thrownjava.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetExceptionBuild info: version: ’3.0.0’, revision: ’350cf60’, time: ’2016-10-13 10:48:16 -0700’System info: host: ’swj-PC’, ip: ’10.0.0.200’, os.name: ’Windows 7’, os.arch: ’amd64’, os.version: ’6.1’, java.version: ’1.8.0_60’Driver info: driver.version: unknownat java.util.concurrent.FutureTask.report(Unknown Source)at java.util.concurrent.FutureTask.get(Unknown Source)at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:183)at org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSession.java:119)at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:95)at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:131)at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:59)at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:36)at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:111)at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:189)at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:222)at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:184)at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:150)at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:808)at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:587)at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:515)at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1061)at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)at org.seleniumhq.jetty9.server.Server.handle(Server.java:499)at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:310)at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:257)at org.seleniumhq.jetty9.io.AbstractConnection$2.run(AbstractConnection.java:540)at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)at java.lang.Thread.run(Unknown Source)Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetExceptionBuild info: version: ’3.0.0’, revision: ’350cf60’, time: ’2016-10-13 10:48:16 -0700’System info: host: ’swj-PC’, ip: ’10.0.0.200’, os.name: ’Windows 7’, os.arch: ’amd64’, os.version: ’6.1’, java.version: ’1.8.0_60’Driver info: driver.version: unknownat org.openqa.selenium.remote.server.FirefoxDriverProvider.callConstructor(FirefoxDriverProvider.java:96)at org.openqa.selenium.remote.server.FirefoxDriverProvider.newInstance(FirefoxDriverProvider.java:64)at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:60)at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:222)at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:209)at java.util.concurrent.FutureTask.run(Unknown Source)at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)... 1 moreCaused by: java.lang.reflect.InvocationTargetExceptionat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)at java.lang.reflect.Constructor.newInstance(Unknown Source)at org.openqa.selenium.remote.server.FirefoxDriverProvider.callConstructor(FirefoxDriverProvider.java:86)... 9 moreCaused by: org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: VISTABuild info: version: ’3.0.0’, revision: ’350cf60’, time: ’2016-10-13 10:48:16 -0700’System info: host: ’swj-PC’, ip: ’10.0.0.200’, os.name: ’Windows 7’, os.arch: ’amd64’, os.version: ’6.1’, java.version: ’1.8.0_60’Driver info: driver.version: FirefoxDriverat org.openqa.selenium.firefox.internal.Executable.<init>(Executable.java:75)at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:60)at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:56)at org.openqa.selenium.firefox.FirefoxDriver.getBinary(FirefoxDriver.java:234)at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:135)... 14 more15:28:38.972 WARN - Exception: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: VISTABuild info: version: ’3.0.0’, revision: ’350cf60’, time: ’2016-10-13 10:48:16 -0700’System info: host: ’swj-PC’, ip: ’10.0.0.200’, os.name: ’Windows 7’, os.arch: ’amd64’, os.version: ’6.1’, java.version: ’1.8.0_60’Driver info: driver.version: FirefoxDriver

问题解答

回答1:

关于macaca的文章可以看下我写的文章:

使用macaca进行hybird测试

标签: web
相关文章: