Avoid "Selenium::WebDriver::Error::UnknownError" sometime on accessing log.

This commit is contained in:
Martin Edenhofer 2016-06-14 15:58:16 +02:00
parent 5218119ce5
commit 51bab574d1

View file

@ -3127,6 +3127,7 @@ wait untill text in selector disabppears
end end
def log(method, params = {}) def log(method, params = {})
begin
instance = params[:browser] || @browser instance = params[:browser] || @browser
if instance if instance
logs = instance.manage.logs.get(:browser) logs = instance.manage.logs.get(:browser)
@ -3135,6 +3136,9 @@ wait untill text in selector disabppears
puts "#{time}/#{log.level}: #{log.message}" puts "#{time}/#{log.level}: #{log.message}"
} }
end end
rescue
# faild to get logs
end
return if !@@debug return if !@@debug
return if params[:mute_log] return if params[:mute_log]
puts "#{Time.zone.now}/#{method}: #{params.inspect}" puts "#{Time.zone.now}/#{method}: #{params.inspect}"