Avoid "Selenium::WebDriver::Error::UnknownError" sometime on accessing log.
This commit is contained in:
parent
5218119ce5
commit
51bab574d1
1 changed files with 11 additions and 7 deletions
|
@ -3127,13 +3127,17 @@ wait untill text in selector disabppears
|
||||||
end
|
end
|
||||||
|
|
||||||
def log(method, params = {})
|
def log(method, params = {})
|
||||||
instance = params[:browser] || @browser
|
begin
|
||||||
if instance
|
instance = params[:browser] || @browser
|
||||||
logs = instance.manage.logs.get(:browser)
|
if instance
|
||||||
logs.each {|log|
|
logs = instance.manage.logs.get(:browser)
|
||||||
time = Time.zone.parse(Time.zone.at(log.timestamp / 1000).to_datetime.to_s)
|
logs.each {|log|
|
||||||
puts "#{time}/#{log.level}: #{log.message}"
|
time = Time.zone.parse(Time.zone.at(log.timestamp / 1000).to_datetime.to_s)
|
||||||
}
|
puts "#{time}/#{log.level}: #{log.message}"
|
||||||
|
}
|
||||||
|
end
|
||||||
|
rescue
|
||||||
|
# faild to get logs
|
||||||
end
|
end
|
||||||
return if !@@debug
|
return if !@@debug
|
||||||
return if params[:mute_log]
|
return if params[:mute_log]
|
||||||
|
|
Loading…
Reference in a new issue