运行环境
操作系统:win7 旗舰版
nodejs:v0.10.18
npm:1.3.8
我是用 git 把 github 上面的 appium clone 下来的,然后放到 nodejs 的 node_modoules 下面
我是想运行 sample-code\examples\node\local-android-wd-chrome.js,根据提示安装了
npm install wd
npm install colors
npm install chai
npm install chai-as-promised
下面是报错提示
C:\Program Files\nodejs\node_modules\appiums\sample-code\examples\node>node loca
l-android-wd-chrome.js
{ [Error: The environment you requested was unavailable.]
data: '{\n "status": 33,\n "value": {\n "message": "A new session could n
ot be created. (Original error: Could not find chromedriver, is it on PATH?)",\n
"origValue": "Could not find chromedriver, is it on PATH?"\n },\n "session
Id": null\n}' }
是说没有安装 chromedriver 或者没有价值 PATH 里面,我就在 google 上面下载这个驱动:
wget http://chromedriver.storage.googleapis.com/2.8/chromedriver_win32.zip
解压好,把 chromedriver 放在下面的目录下面,
D:\Program Files\adt-bundle20130522\drivers
然后在高级系统设置 -> 环境变量 ->系统变量 里面编辑 PATH,在最后面加上;D:\Program Files\adt-bundle20130522\drivers
重新打开 cmd,找到运行 local-android-wd-chrome.js 的目录,node local-android-wd-chrome.js,还是提示说没有找到 chromedriver
C:\Program Files\nodejs\node_modules\appiums\sample-code\examples\node>node loca
l-android-wd-chrome.js
{ [Error: The environment you requested was unavailable.]
data: '{\n "status": 33,\n "value": {\n "message": "A new session could n
ot be created. (Original error: Could not find chromedriver, is it on PATH?)",\n
"origValue": "Could not find chromedriver, is it on PATH?"\n },\n "session
Id": null\n}' }
C:\Program Files\nodejs\node_modules\wd\node_modules\q\q.js:126
throw e;
^
Error: The environment you requested was unavailable.
at C:\Program Files\nodejs\node_modules\wd\lib\webdriver.js:360:15
at Request._callback (C:\Program Files\nodejs\node_modules\wd\lib\webdriver.
js:281:7)
at Request.self.callback (C:\Program Files\nodejs\node_modules\wd\node_modul
es\request\index.js:148:22)
at Request.EventEmitter.emit (events.js:98:17)
at Request. (C:\Program Files\nodejs\node_modules\wd\node_modules
\request\index.js:876:14)
at Request.EventEmitter.emit (events.js:117:20)
at IncomingMessage. (C:\Program Files\nodejs\node_modules\wd\node
_modules\request\index.js:827:12)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickCallback (node.js:415:13)