更改域名时出现烦人的 Webrat/Selenium 警告

发布于 2024-08-09 14:08:20 字数 491 浏览 4 评论 0原文

当我在 Selenium 模式下使用 AJAX + Webrat 时,我经常会遇到 指定真实域和子域。因此我会得到这个 留言很多:

14:00:45.222 警告 - 您似乎是 更改域名来自 http://test.host:3001http://elabs.test.host:3001/dashboard 这可能会导致“权限被拒绝” 从浏览器(除非它正在运行) 作为 *iehta 或 *chrome,或者 selenium 服务器正在运行 代理注入模式)

虽然准确,但它会阻塞我的输出并且对我来说毫无用处。 关于如何在运行时抑制此消息的任何想法 硒模式?

When I'm working with AJAX + Webrat in Selenium mode, I'll often have
to specify real domains and subdomains. Consequentially I'll get this
message a lot:

14:00:45.222 WARN - you appear to be
changing domains from
http://test.host:3001 to
http://elabs.test.host:3001/dashboard
this may lead to a 'Permission denied'
from the browser (unless it is running
as *iehta or *chrome, or alternatively
the selenium server is running in
proxy injection mode)

While accurate, it clogs up my output and is pretty useless to me.
Any ideas on how to get suppress this message while running in
Selenium mode?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

后eg是否自 2024-08-16 14:08:20

您可以在 webrat 配置中添加 2 个额外的配置参数:

 Webrat.configure do |config|
  config.mode = :selenium
  config.application_address = "elabs.test.host"
  config.application_port = "3001/dashboard"
  // other properties
end

我知道该端口看起来很奇怪,但 webrat 执行简单的字符串连接(地址 + 端口)。

You can and 2 extra config parameters to your webrat configuration:

 Webrat.configure do |config|
  config.mode = :selenium
  config.application_address = "elabs.test.host"
  config.application_port = "3001/dashboard"
  // other properties
end

The port looks weird I know but webrat does simple string concatenation (address + port).

因为看清所以看轻 2024-08-16 14:08:20

或者,您可以在 config.application_address 中指定基本 url 并跳过 application_port:

Webrat.configure do |config|
  config.mode = :selenium
  config.application_address = "elabs.test.host:3001/dashboard/"
  // other properties
end

alternatively, you could specify your base url in config.application_address and skip the application_port:

Webrat.configure do |config|
  config.mode = :selenium
  config.application_address = "elabs.test.host:3001/dashboard/"
  // other properties
end
万水千山粽是情ミ 2024-08-16 14:08:20

我遇到了完全相同的问题,这是由于访问错误的 URL 引起的。像这样:

def path_to(page_name)
    case page_name

    when /home/
      url_for(:controller => 'admin/colaboracao', :action => 'show')

这是如何解决的:

def path_to(page_name)
    case page_name

    when /home/
      '/admin/colaboracao'

I had exctaly the same problem and the it was caused by accessing the wrong URL. Like this:

def path_to(page_name)
    case page_name

    when /home/
      url_for(:controller => 'admin/colaboracao', :action => 'show')

This is how it was solved:

def path_to(page_name)
    case page_name

    when /home/
      '/admin/colaboracao'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文