使用Windows任务计划程序时,在Firefox中运行Nightwatch测试失败

时间:2018-02-19 13:17:13

标签: windows selenium firefox nightwatch.js geckodriver

我想使用Windows任务计划程序在后台使用Firefox运行Nightwatch Test。我可以手动运行测试。但是,当我使用Windows任务计划程序运行任务时出现错误。硒成功启动但Firefox / Gecko驱动程序出现问题。 IE和Chrome测试成功。

我已阅读此discussion

  

andreastt于2017年9月11日发表评论

     

geckodriver不支持作为Windows服务运行。

我该如何解决这个问题?是否有任何解决方法以便Geckodriver可以在后台运行? (作为Windows服务)或者在后台有没有其他方法可以在Firefox中运行Nightwatch测试?

这是我的 Nightwatch.json 文件:

{
  "src_folders" : ["tests"],
  "output_folder" : "reports",
  "custom_commands_path" : "",
  "page_objects_path" : "",
  "custom_assertions_path" : "",
  "globals_path" : "./global/globals.js",
  "live_output" : false,
  "parallel_process_delay" : 10,
  "disable_colors": false,
  "test_workers" : false,

  "selenium" : {
    "start_process" : true,
    "server_path" : "./selenium/selenium391.jar",
    "log_path" : "./reports",
    "host" : "127.0.0.1",
    "port" : 4444,
    "cli_args" : {
      "webdriver.chrome.driver" : "./selenium/chromedriver.exe",
      "webdriver.ie.driver" : "./selenium/IEDriverServer.exe",
      "webdriver.gecko.driver" : "./selenium/geckodriver.exe"
    }
  },

  "test_settings" : {
    "default" : {
      "launch_url" : "http://localhost",
      "selenium_host" : "127.0.0.1",
      "selenium_port" : 4444,
      "silent" : true,
      "disable_colors": false,
      "screenshots" : {
        "enabled" : false,
        "path" : ""
      },
      "desiredCapabilities" : {
        "browserName" : "firefox",
        "javascriptEnabled" : true,
        "acceptSslCerts" : true
      }
    },

这是我遇到的错误 selenium-debug.log

12:49:00.828 INFO - Selenium build info: version: '3.9.1', revision: '63f7b50'
12:49:00.828 INFO - Launching a standalone Selenium Server on port 4444
2018-02-19 12:49:00.922:INFO::main: Logging initialized @364ms to org.seleniumhq.jetty9.util.log.StdErrLog
2018-02-19 12:49:01.046:INFO:osjs.Server:main: jetty-9.4.7.v20170914, build timestamp: 2017-11-21T22:27:37+01:00, git hash: 82b8fb23f757335bb3329d540ce37a2a2615f0a8
2018-02-19 12:49:01.093:WARN:osjs.SecurityHandler:main: ServletContext@o.s.j.s.ServletContextHandler@2b9627bc{/,null,STARTING} has uncovered http methods for path: /
2018-02-19 12:49:01.093:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@2b9627bc{/,null,AVAILABLE}
2018-02-19 12:49:01.499:INFO:osjs.AbstractConnector:main: Started ServerConnector@646d64ab{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
2018-02-19 12:49:01.499:INFO:osjs.Server:main: Started @940ms
12:49:01.499 INFO - Selenium Server is up and running on port 4444
2018-02-19 12:49:01.686:INFO:osjshC.ROOT:qtp110456297-15: org.openqa.selenium.remote.server.WebDriverServlet-27efef64: Initialising WebDriverServlet
12:49:01.748 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.BeginSession@65dcd5b7
12:49:01.748 INFO - /session: Executing POST on /session (handler: BeginSession)
12:49:01.826 INFO - Capabilities are: Capabilities {acceptSslCerts: true, browserName: firefox, javascriptEnabled: true, name: Google Wiki}
12:49:01.826 INFO - Capabilities {acceptSslCerts: true, browserName: firefox, javascriptEnabled: true, name: Google Wiki} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.firefox.GeckoDriverService)
1519040941951   geckodriver INFO    geckodriver 0.19.1
1519040941967   geckodriver INFO    Listening on 127.0.0.1:8022
1519040943074   mozrunner::runner   INFO    Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\Username\\AppData\\Local\\Temp\\rust_mozprofile.pHPWQBBUG5ZG"
1519040944766   Marionette  INFO    Enabled via --marionette

###!!! [Parent][MessageChannel] Error: (msgtype=0x2C0058,name=PContent::Msg_SetPluginList) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C004D,name=PContent::Msg_GMPsChanged) Channel error: cannot send/recv


###!!! [Parent][RunMessage] Error: Channel error: cannot send/recv


###!!! [Parent][RunMessage] Error: Channel error: cannot send/recv


###!!! [Parent][RunMessage] Error: Channel error: cannot send/recv


###!!! [Parent][RunMessage] Error: Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x150090,name=PBrowser::Msg_UpdateNativeWindowHandle) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x150084,name=PBrowser::Msg_Destroy) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C0040,name=PContent::Msg_LoadProcessScript) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x150081,name=PBrowser::Msg_LoadRemoteScript) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C0040,name=PContent::Msg_LoadProcessScript) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C0040,name=PContent::Msg_LoadProcessScript) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C00FE,name=PContent::Msg_AsyncMessage) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x150001,name=PBrowser::Msg_AsyncMessage) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x2C001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv


###!!! [Parent][RunMessage] Error: Channel error: cannot send/recv


###!!! [Parent][RunMessage] Error: Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x150090,name=PBrowser::Msg_UpdateNativeWindowHandle) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x150084,name=PBrowser::Msg_Destroy) Channel error: cannot send/recv

A content process crashed and MOZ_CRASHREPORTER_SHUTDOWN is set, shutting down
Unable to read VR Path Registry from C:\Users\Username\AppData\Local\openvr\openvrpaths.vrpath
JavaScript error: resource://shield-recipe-client/lib/ShieldRecipeClient.jsm, line 70: TypeError: log is undefined

###!!! [Parent][MessageChannel] Error: (msgtype=0x150090,name=PBrowser::Msg_UpdateNativeWindowHandle) Channel error: cannot send/recv


###!!! [Parent][MessageChannel] Error: (msgtype=0x150084,name=PBrowser::Msg_Destroy) Channel error: cannot send/recv

A content process crashed and MOZ_CRASHREPORTER_SHUTDOWN is set, shutting down
*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping

0 个答案:

没有答案