开发者

Annoying Webrat/Selenium Warning when changing domain names

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.2开发者_Python百科22 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?


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).


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


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'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜