我在运行Selenium Ruby Web驱动程序脚本时遇到问题,如下所示:
Selenium 完成运行我的脚本后,浏览器将关闭(这是预期行为)。但是,紧接着,浏览器重新打开,什么都不做,然后关闭,连续,浏览器重新打开然后关闭。在浏览器(FF16,IE9或Chrome)完全关闭之前,此操作重复了大约4次。
每次打开浏览器时都会显示以下日志消息,并且闭。请注意,我正在使用 @driver.quit 关闭浏览器。请帮助指导我克服这个问题需要做的事情不方便的情况。非常感谢。
*** LOG addons.xpi: shutdown
E*** LOG addons.manager: Application has been upgraded
*** LOG addons.xpi: startup
*** LOG addons.xpi: Skipping unavailable install location app-system-local
*** LOG addons.xpi: Skipping unavailable install location app-system-share
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi-utils: Opening database
*** LOG addons.xpi-utils: Creating database schema
*** LOG addons.xpi: New add-on fxdriver@googlecode.com installed in app-prof
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
*** LOG addons.xpi: New add-on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} instal
in app-global
*** LOG addons.xpi: New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} instal
in app-global
*** LOG addons.xpi: Updating database with changes to installed add-ons
*** LOG addons.xpi-utils: Updating add-on states
*** LOG addons.xpi-utils: Writing add-ons list
*** LOG addons.xpi: shutdown
*** LOG addons.xpi-utils: shutdown
*** LOG addons.xpi-utils: Database closed
*** LOG addons.xpi: startup
*** LOG addons.xpi: Skipping unavailable install location app-system-local
*** LOG addons.xpi: Skipping unavailable install location app-system-share
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi: No changes found
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
!!! error running onStopped callback: TypeError: callback is not a function
*** LOG addons.xpi: shutdown
E*** LOG addons.manager: Application has been upgraded
*** LOG addons.xpi: startup
*** LOG addons.xpi: Skipping unavailable install location app-system-local
*** LOG addons.xpi: Skipping unavailable install location app-system-share
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi-utils: Opening database
*** LOG addons.xpi-utils: Creating database schema
*** LOG addons.xpi: New add-on fxdriver@googlecode.com installed in app-prof
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
*** LOG addons.xpi: New add-on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} instal
in app-global
*** LOG addons.xpi: New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} instal
in app-global
*** LOG addons.xpi: Updating database with changes to installed add-ons
*** LOG addons.xpi-utils: Updating add-on states
*** LOG addons.xpi-utils: Writing add-ons list
*** LOG addons.xpi: shutdown
*** LOG addons.xpi-utils: shutdown
*** LOG addons.xpi-utils: Database closed
*** LOG addons.xpi: startup
*** LOG addons.xpi: Skipping unavailable install location app-system-local
*** LOG addons.xpi: Skipping unavailable install location app-system-share
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi: No changes found
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
!!! error running onStopped callback: TypeError: callback is not a function
*** LOG addons.xpi: shutdown
E*** LOG addons.manager: Application has been upgraded
*** LOG addons.xpi: startup
*** LOG addons.xpi: Skipping unavailable install location app-system-local
*** LOG addons.xpi: Skipping unavailable install location app-system-share
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi-utils: Opening database
*** LOG addons.xpi-utils: Creating database schema
*** LOG addons.xpi: New add-on fxdriver@googlecode.com installed in app-prof
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
*** LOG addons.xpi: New add-on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} instal
in app-global
*** LOG addons.xpi: New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} instal
in app-global
*** LOG addons.xpi: Updating database with changes to installed add-ons
*** LOG addons.xpi-utils: Updating add-on states
*** LOG addons.xpi-utils: Writing add-ons list
*** LOG addons.xpi: shutdown
*** LOG addons.xpi-utils: shutdown
*** LOG addons.xpi-utils: Database closed
*** LOG addons.xpi: startup
*** LOG addons.xpi: Skipping unavailable install location app-system-local
*** LOG addons.xpi: Skipping unavailable install location app-system-share
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi: No changes found
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
!!! error running onStopped callback: TypeError: callback is not a function
发生此问题是因为我在脚本中命名了一些带有"test_"前缀的函数。只需从这些函数的名称中删除"test_"前缀,问题就已解决。