【问题标题】:getting an unwanted messages from selenium-webdriver, how to hide that?从 selenium-webdriver 收到不需要的消息,如何隐藏它?
【发布时间】:2013-01-10 19:35:56
【问题描述】:

我正在使用 selenium-webdriver 自动执行与 Web 浏览器相关的任务。但是当我执行以下操作时,得到了如下的 messgaes 块。为什么会这样,你能告诉我吗?以及如何压制它的任何想法?

irb(main):001:0> require "selenium-webdriver"
=> true
irb(main):002:0> driver=Selenium::WebDriver.for :firefox
*** LOG addons.manager: Application has been upgraded
*** LOG addons.xpi: startup
*** WARN addons.xpi: Ignoring missing add-on in C:\Program Files\SearchPredict\P
RFireFox
*** WARN addons.xpi: Ignoring missing add-on in C:\Program Files\SpeedBit Video
Downloader\SPFireFox
*** WARN addons.xpi: Ignoring missing add-on in C:\Program Files\Web Assistant\F
irefox
*** WARN addons.xpi: Ignoring missing add-on in C:\Program Files\Iminent\webboos
ter@iminent.com
*** 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-profile
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
*** LOG addons.xpi: New add-on {F17C1572-C9EC-4e5c-A542-D05CBB5C5A08} installed
in winreg-app-user
*** LOG addons.xpi: New add-on ffxtlbr@babylon.com installed in app-global
*** WARN addons.xpi: Add-on is invalid: Error: Directory C:\Program Files\Mozill
a Firefox\extensions\ffxtlbr@babylon.com does not contain a valid install manife
st
*** WARN addons.xpi: Could not uninstall invalid item from locked install locati
on
*** LOG addons.xpi: New add-on {1FD91A9C-410C-4090-BBCC-55D3450EF433} installed
in app-global
*** LOG addons.xpi: New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed
in app-global
*** LOG addons.xpi: New add-on m3ffxtbr@mywebsearch.com installed in winreg-app-
global
*** LOG addons.xpi: New add-on avg@toolbar installed in winreg-app-global
*** LOG addons.xpi: New add-on daplinkchecker@speedbit.com installed in winreg-a
pp-global
*** LOG addons.xpi: New add-on wrc@avast.com installed in winreg-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.manager: shutdown
*** LOG addons.xpi: shutdown
*** LOG addons.xpi-utils: shutdown
*** LOG addons.xpi-utils: Database closed
*** LOG addons.xpi: startup
*** WARN addons.xpi: Ignoring missing add-on in C:\Program Files\SearchPredict\P
RFireFox
*** WARN addons.xpi: Ignoring missing add-on in C:\Program Files\SpeedBit Video
Downloader\SPFireFox
*** WARN addons.xpi: Ignoring missing add-on in C:\Program Files\Web Assistant\F
irefox
*** WARN addons.xpi: Ignoring missing add-on in C:\Program Files\Iminent\webboos
ter@iminent.com
*** 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
=> #<Selenium::WebDriver::Driver:0x..fbe37f7d8 browser=:firefox>
irb(main):003:0>

【问题讨论】:

  • 你弄明白了吗?我遇到了完全相同的问题。
  • @Jaepetto 我还没有。你能重新打开post 或投票吗!

标签: ruby selenium-webdriver ruby-1.9.3


【解决方案1】:

您的 Firefox 配置文件正在启动时检查附加组件。当我在 Windows 中开发基于 Ruby 的 Selenium 测试时,我经常收到此消息。切换到 Mac OS X 然后再切换到 Ubuntu 实际上似乎为我解决了这个问题,但由于这有点极端,你可以做一个解决方法。

首先,您需要在 Firefox 中设置一个在启动时不检查附加组件的新配置文件。这是您需要在该配置文件上设置的选项的一个主题:link。以下是 Mozilla 关于如何使用 Firefox 配置文件管理器的参考,以备不时之需:link

然后在你的 Ruby 代码中,你有这样的东西:

driver = Selenium::WebDriver.for :firefox

您需要添加一个选项来告诉 Webdriver 要使用哪个配置文件。它最终会变成这样:

driver = Selenium::WebDriver.for :firefox, :profile => "selenium_testing"

(只需将“selenium_testing”替换为您为新配置文件命名的任何内容。)

然后你应该能够启动 Firefox 而没有那些恼人的警告。

【讨论】:

    【解决方案2】:

    我通过将 Firefox 升级到旧版本(与 Selenium-WebDriver 配合良好)解决了这个问题。就我而言,我不得不降级回Firefox 18,而这个版本与Selenium 2.27一起工作

    查看older versions of Firefox

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-21
      • 1970-01-01
      • 2016-07-09
      相关资源
      最近更新 更多