3

使用 Windows 7 在 node_modules\protractor 中启动 webdriver-manager 时遇到问题。命令是:

node webdriver-manager start

然后我收到以下错误消息:

seleniumProcess.pid: undefined
events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: spawn ENOENT
    at exports._errnoException (util.js:742:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1028:32)
    at child_process.js:1109:20
    at process._tickCallback (node.js:343:11)
    at Function.Module.runMain (module.js:492:11)
    at startup (node.js:124:16)
    at node.js:807:3

在互联网上搜索后,我找不到任何类似的问题,即 seleniumProcess.pid 未定义。

以下是 java -version 的输出:

java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

任何想法?

4

3 回答 3

2

Ok, I figured out why I had this problem. You have only JRE, but

You will need to have the Java Development Kit (JDK) installed to run the standalone Selenium Server. Check this by running java -version from the command line. Tutorial

On Ubuntu I've done

$ sudo apt-get install openjdk-7-jdk

And now I have this Java:

$ java -version
java version "1.7.0_95"
OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-0ubuntu0.15.10.1)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)

And webdriver-manager start works.

于 2016-03-12T10:32:42.383 回答
0

尝试添加C:\Windows\System32\ there (right-click My Computer -> Properties -> Advanced system settings -> Environment Variables -> Edit...PATH 并添加C:\Windows\System32到末尾(用分号分隔每个变量)。

于 2020-03-18T12:55:38.477 回答
0

错误:C:\XXXX\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\bin>webdriver-manager --verbose update

events.js:160 抛出 er;// 未处理的“错误”事件 ^

错误:无法在 TLSSocket 的错误(本机)处验证第一个证书。(_tls_wrap.js:1092:38) 在 emitNone (events.js:86:13) 在 TLSSocket.emit (events.js:185:7) 在 TLSSocket._finishInit (_tls_wrap.js:610:8) 在 TLSWrap.ssl .onhandshakedone (_tls_wrap.js:440:38)

我做了以下操作来删除它:

尝试: 1. C:\XX\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\bin>webdriver-manager --proxy http://username:passwd@IP:port 080/ 更新(然后更新当地司机)

  1. webdriver-manager 状态

  2. C:\XX\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\bin>webdriver-manager --verbose start

它开始工作,我预计由于驱动程序的腐败而反复发生这种情况。愿我们需要优雅地停下来工作。

于 2017-05-08T06:51:14.740 回答