Ruby warning selenium webdriver log messages

I recorded some tests using ide and then exported them to ruby ​​/ rspec. When I run them, they work, but I get a lot of warnings. Can you tell me how to get rid of this warning?

 net/http: warning: Content-Type did not set; using application/x-www-form-urlencoded

I get this every time I try to call the find driver element.

+4
source share
1 answer

I still have this problem in 2018 for some Selenium teams. Workaround:

module Selenium
    module WebDriver
        module Remote
            module Http
                class Common
                    ORIGINAL_DEFAULT_HEADERS = DEFAULT_HEADERS
                    remove_const :DEFAULT_HEADERS
                    DEFAULT_HEADERS = ORIGINAL_DEFAULT_HEADERS.merge( 'Content-Type' => 'application/x-www-form-urlencoded' ).freeze
                end
            end
        end
    end
end
0
source

All Articles