我正在尝试安装selenium standalone

时间:2017-10-18 14:32:37

标签: selenium

我正在尝试在vs代码中使用此命令安装selenium standalone:

selenium-standalone install

但它显示以下错误:

 **

selenium-standalone install    selenium-standalone : The term 'selenium-standalone' is not recognized as the name of a cmdlet, function, script file, or    operable program. Check the spelling of the name, or if a path was    included, verify that    the path is correct and try again.    At line:1 char:1    + selenium-standalone install    + ~~~~~~~~~~~~~~~~~~~
       + CategoryInfo          : ObjectNotFound: (selenium-standalone:String) [], CommandNotFoundException
       + FullyQualifiedErrorId : CommandNotFoundException****strong text****

**

1 个答案:

答案 0 :(得分:4)

您需要将selenium-standalone安装为全局程序包,然后将全局程序包安装文件夹附加到PATH Envirormen变量中。

  1. 执行' npm install -g selenium-standalone'
  2. 执行&nbsp config获取前缀',它将打印出文件夹路径,复制此路径并打开“Envirormen Variable'从Windows控制面板或右侧菜单设置对话框:'属性' '我的电脑'。
  3. 在' PATH'的当前值末尾添加分号。 Envirormen变量,然后追加到路径之上。
  4. 打开新终端以执行“selenium-standalone install' (不要在旧的开放终端上执行命令)
  5. enter image description here