简体   繁体   English

“量角器”不被识别为内部或外部命令,可操作程序或批处理文件

[英]'protractor' is not recognized as an internal or external command, operable program or batch file

I am able to run my protractor from a batch file (protractor conf.js) and the script is working fine I have installed my protractor globally and done environment settings too. 我可以从批处理文件(量角器conf.js)运行量角器,并且脚本运行良好,我已在全局安装了量角器并完成了环境设置。 But when I am running my batch file from eclipse after doing settings from external tool configuration .its giving error "'protractor' is not recognized as an internal or external command, operable program or batch file." 但是,当我从外部工具配置中进行设置后,从eclipse运行我的批处理文件时,它给出错误“'量角器'未被识别为内部或外部命令,可操作程序或批处理文件”。 My conf.js 我的conf.js

      exports.config = {
  framework: 'jasmine',
  seleniumAddress: 'http://localhost:4444/wd/hub',
  specs: ['spec.js']
}

My spec.js 我的spec.js

describe('Protractor Demo App', function() {
  it('should have a title', function() {
    browser.get('http://juliemr.github.io/protractor-demo/');

    expect(browser.getTitle()).toEqual('Super Calculator');
  });
});

My runner.bat 我的Runner.bat

protractor conf.js

Eclipse设置运行批处理文件

If you double confirmed the global protractor install folder had in PATH environment, and it still can't work. 如果您再次确认全局量角器安装文件夹位于PATH环境中,则仍然无法使用。 Please try to add a PATH in Environment Tab of Eclipse run configuration, and point the PATH to global protractor install folder as following: 请尝试在Eclipse运行配置的“ Environment选项卡中添加PATH ,并将PATH指向全局量角器安装文件夹,如下所示:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM