日志中的selenium webdriver ruby 警告消息

问题描述 投票:4回答:1

我使用ide记录了一些测试,然后将它们导出到ruby / rspec。当我运行它们时它们起作用,但是我收到很多警告。你能告诉我如何摆脱这个警告吗?

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

每当我尝试调用驱动程序查找元素时,我都会得到这个。

selenium rspec selenium-webdriver
1个回答
1
投票

我在2018年仍然遇到一些Selenium命令。解决方法:

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
© www.soinside.com 2019 - 2024. All rights reserved.