lib/element.rb in gridium-1.0.18 vs lib/element.rb in gridium-1.0.19

- old
+ new

@@ -51,11 +51,15 @@ elements.each do |element| if element.displayed? #removed check for element.enabled found_element = element; #this will always return the last displayed element end end - rescue StandardError + if found_element.nil? + Log.debug "found #{elements.length} element(s) via #{@by} and #{@locator} and 0 are displayed" + end + rescue StandardError => error + Log.debug("element.displayed_element rescued: #{error}") if found_element Log.warn("An element was found, but it was not displayed on the page. Gridium.config.visible_elements_only set to: #{Gridium.config.visible_elements_only} Element: #{self.to_s}") else Log.warn("Could not find Element: #{self.to_s}") end @@ -86,17 +90,19 @@ element.attribute(name) end def present? return element.enabled? - rescue StandardError + rescue StandardError => error + Log.debug("element.present? is false because this error was rescued: #{error}") return false end def displayed? return element.displayed? - rescue StandardError + rescue StandardError => error + Log.debug("element.displayed? is false because this error was rescued: #{error}") return false end def enabled? element.enabled? @@ -338,10 +344,11 @@ private def stale? return true if @element.nil? @element.disabled? - rescue StandardError + rescue StandardError => error + Log.debug("element.stale? is true because this error was rescued: #{error}") Log.warn("Stale element detected.... #{self.to_s}") return true end #