Exception: Ferrum::NodeMovingError

Inherits:
Error
  • Object
show all
Defined in:
lib/ferrum/errors.rb

Overview

Raised when a node keeps moving between attempts to interact with it, e.g. while trying to click it.

Instance Method Summary collapse

Constructor Details

#initialize(node, prev, current) ⇒ NodeMovingError

Returns a new instance of NodeMovingError.



91
92
93
94
95
96
# File 'lib/ferrum/errors.rb', line 91

def initialize(node, prev, current)
  @node = node
  @prev = prev
  @current = current
  super(message)
end

Instance Method Details

#messageString

Explains that the node moved between attempts to interact with it.

Returns:

  • (String)


103
104
105
106
107
# File 'lib/ferrum/errors.rb', line 103

def message
  "#{@node.inspect} that you're trying to click is moving, hence " \
    "we cannot. Previously it was at #{@prev.inspect} but now at " \
    "#{@current.inspect}."
end