不断补充中。。
0、maven 启动 测试用例 报错问题。
错误日志如下。
***********************日志bigan*************************************
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.0:npm (npm install) on project aip-demo-webdriver.js: Failed to run task: 'npm install' failed. java.io.IOException: Cannot run program "W:\AutoTestProject\LawEditorial-autotest\node\node.exe" (in directory "W:\AutoTestProject\LawEditorial-autotest"): CreateProcess error=193, %1 ??????Ч?? Win32 ??ó -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
***********************日志end*************************************
http://stackoverflow.com/questions/25511402/java-io-ioexception-cannot-run-program-createprocess-error-193-1-is-not-a
http://stackoverflow.com/questions/12637203/why-does-createprocess-give-error-193-1-is-not-a-valid-win32-app
1、代理设置问题。
win10 系统,lantern 软件, 启动软件后,启动项目一直报错,firefox 拒绝访问,chrome 浏览器崩溃。
2、chromedriver.exe 找不到。
需要把 chromedriver.exe放到项目根目录下。 否则会报错,让你下载 chromedriver.exe ,
也可以配置path ,指定到 .exe 的目录(好像是可以?)
或者,改 文件 node_modules \ selenium-webdriver \ chrome.js
改 第 183行。
let exe = opt_exe || io.findInPath(CHROMEDRIVER_EXE, true);
//let exe = opt_exe || 'C:\\ASDF\\AAA\\chromedriver.ese';
屏蔽的那句,代替 没有屏蔽的那句。
要用 双 反斜杠 ,指明路径就可以了。
3、chrome 可以 运行,firefox 不可以运行。
3.1、chrome 可以成功运行,而firefox 不启动浏览器,直接秒退 ,控制台报错。
是因为你的 firefox 版本太低,升级到 48及以上版本就可以了。
3.2、chrome 可以运行,firefox ,不秒退,但是不能运行,报错如下:
****************************************** 错误日志begin*****************************************
Failures:
1) Scenario: Test The ideal of the topic - features\abc.feature:8
Step: After
Step Definition: features\support\hooks.js:10
Message:
Error: Timed out waiting for the WebDriver server at http://127.0.0.1:49897/hub
at Error (native)
at onError (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\http\util.js:87:11)
at ManagedPromise.invokeCallback_ (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\lib\promise.js:1379:14)
at TaskQueue.execute_ (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\lib\promise.js:2913:14)
at TaskQueue.executeNext_ (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\lib\promise.js:2896:21)
at W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\lib\promise.js:2775:27
at W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\lib\promise.js:639:7
at process._tickCallback (node.js:369:9)
From: Task: WebDriver.createSession()
at Function.createSession (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\lib\webdriver.js:329:24)
at Driver (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\firefox\index.js:386:38)
at Builder.build (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\builder.js:467:16)
at buildFirefoxdrive (W:\AutoTestProject\LawEditorial-autotest\features\support\world.js:15:37)
at Object. (W:\AutoTestProject\LawEditorial-autotest\features\support\world.js:20:14)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
From: Task: WebDriver.manage().timeouts().implicitlyWait(50000)
at Driver.schedule (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\lib\webdriver.js:377:17)
at Timeouts.implicitlyWait (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\lib\webdriver.js:1287:25)
at new World (W:\AutoTestProject\LawEditorial-autotest\features\support\world.js:38:28)
1 scenario (1 failed)
4 steps (4 passed)
0m46.457s
>> W:\AutoTestProject\LawEditorial-autotest\node_modules\cucumber\lib\cucumber\runtime\event_broadcaster.js:30
>> throw error;
>> ^
>>
>> Error: Timed out waiting for the WebDriver server at http://127.0.0.1:49897/hub
>> at Error (native)
>> at onError (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\http\util.js:87:11)
>> at ManagedPromise.invokeCallback_ (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\lib\promise.js:1379:14)
>> at TaskQueue.execute_ (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\lib\promise.js:2913:14)
>> at TaskQueue.executeNext_ (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\lib\promise.js:2896:21)
>> at W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\lib\promise.js:2775:27
>> at W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\lib\promise.js:639:7
>> at process._tickCallback (node.js:369:9)
>> From: Task: WebDriver.createSession()
>> at Function.createSession (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\lib\webdriver.js:329:24)
>> at Driver (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\firefox\index.js:386:38)
>> at Builder.build (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\builder.js:467:16)
>> at buildFirefoxdrive (W:\AutoTestProject\LawEditorial-autotest\features\support\world.js:15:37)
>> at Object. (W:\AutoTestProject\LawEditorial-autotest\features\support\world.js:20:14)
>> at Module._compile (module.js:409:26)
>> at Object.Module._extensions..js (module.js:416:10)
>> at Module.load (module.js:343:32)
>> at Function.Module._load (module.js:300:12)
>> at Module.require (module.js:353:17)
>> From: Task: WebDriver.manage().timeouts().implicitlyWait(50000)
>> at Driver.schedule (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\lib\webdriver.js:377:17)
>> at Timeouts.implicitlyWait (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\lib\webdriver.js:1287:25)
>> at new World (W:\AutoTestProject\LawEditorial-autotest\features\support\world.js:38:28)
>> From: Task: WebDriver.quit()
>> at Driver.schedule (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\lib\webdriver.js:377:17)
>> at Driver.quit (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\lib\webdriver.js:443:23)
>> at Driver.onQuit.quit (W:\AutoTestProject\LawEditorial-autotest\node_modules\selenium-webdriver\firefox\index.js:393:14)
>> at W:\AutoTestProject\LawEditorial-autotest\features\support\hooks.js:26:11
>> at nextTickCallbackWith0Args (node.js:420:9)
>> at Immediate._tickCallback [as _onImmediate] (node.js:349:13)
>> Exited with code: 7.
Warning: Task "exec:run_firefox" failed. Use --force to continue.
Aborted due to warnings.
这个错误,我还没有解决,-.-!