Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Silencing Chrome driver console outputs when I run my tests

I am using latest versions of Chrome(32.0.1700.107) and Chrome driver(V2.8). But when I run my sample test with following code in Ruby:

    require 'selenium-webdriver'
    WAIT = Selenium::WebDriver::Wait.new(timeout: 100)
    $driver = Selenium::WebDriver.for :chrome
    $driver.manage.window.maximize
    $driver.navigate.to 'https://www.google.co.in'

     def apps_hover
      ele_hover = $driver.find_element(:xpath, ".//*[@id='gbwa']/div[1]/a")
      $driver.action.move_to(ele_hover).perform
      sleep 5
      puts"Pass"
     end

     apps_hover
    $driver.quit()

I get the console output from chrome driver at the beginning like following :

[5032:4816:0218/130016:ERROR:chrome_views_delegate.cc(176)] NOT IMPLEMENTED [5032:4816:0218/130016:ERROR:desktop_root_window_host_win.cc(746)] NOT IMPLEMENTED [5032:4816:0218/130016:ERROR:desktop_root_window_host_win.cc(746)] NOT IMPLEMENTED.

Is there a way to silence these console outputs?

like image 847
Rain Avatar asked Feb 18 '14 07:02

Rain


1 Answers

I haven't found a way to silence chrome driver warnings directly. You can however write a filter script fairly easily which processes each line of output and excludes these lines from STDOUT or STDERR (depending on which way they are being sent).

Related: Best practices in dealing with STDIN in ruby

like image 91
Matt Sanders Avatar answered Oct 18 '22 12:10

Matt Sanders