【问题标题】:Nodejs exec is not workingNodejs 执行不工作
【发布时间】:2014-09-22 13:36:01
【问题描述】:

我正在使用 exec 执行一些 DOS 命令:

java -jar D:\selenium\selenium-server-standalone-2.40.0.jar -htmlSuite "*firefox3 C:\Users\AppData\Local\Mozilla Firefox\firefox.exe" "http://google.com" "D:\selenium\TS2.html" "D:\selenium\Res3.html"

喜欢

exec(['java','-jar','D:/selenium/selenium-server-standalone-2.40.0.jar','-htmlSuite','"*firefox3','C:/Users/AppData/Local/Mozilla Firefox/firefox.exe"','"http://google.com"','"D:/selenium/TS2.html"','"D:/selenium/Res3.html"'], function(err, out, code) {

});

将错误显示为

HTML suite exception seen:
java.io.IOException: The filename, directory name, or volume label syntax is incorrect

请帮我执行这个命令 在此先感谢:)

【问题讨论】:

    标签: javascript node.js selenium exec dos


    【解决方案1】:

    -htmlSuite 参数的值被分成两部分。

    您可能应该在路径名中使用反斜杠 (because you're on dos/win):

        exec(['java','-jar','D:\\selenium\\selenium-server-standalone-2.40.0.jar','-htmlSuite','"*firefox3 C:\\Users\\AppData\\Local\\Mozilla Firefox\\firefox.exe"','"http://google.com"','"D:\\selenium\\TS2.html"','"D:\\selenium\\Res3.html"'], function(err, out, code) {
    
    });

    【讨论】:

      猜你喜欢
      • 2017-04-07
      • 2013-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-09
      • 1970-01-01
      • 2014-11-22
      相关资源
      最近更新 更多