This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Action related to scrolling a wheel.
Instance Attribute Summary Attributes inherited from Interaction Instance Method Summary collapseA new instance of Scroll.
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Scroll.
30 31 32 33 34 35 36 37 38 39 40 41
# File 'rb/lib/selenium/webdriver/common/interactions/scroll.rb', line 30 def initialize(source:, origin: :viewport, duration: 0.25, **opts) super(source) @type = :scroll @duration = duration * 1000 @origin = origin @x_offset = opts.delete(:x) || 0 @y_offset = opts.delete(:y) || 0 @delta_x = opts.delete(:delta_x) || 0 @delta_y = opts.delete(:delta_y) || 0 raise ArgumentError, "Invalid arguments: #{opts.keys}" unless opts.empty? endInstance Method Details #assert_source(source) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
43 44 45
# File 'rb/lib/selenium/webdriver/common/interactions/scroll.rb', line 43 def assert_source(source) raise TypeError, "#{source.type} is not a valid input type" unless source.is_a? WheelInput end#encode ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 50 51 52 53 54 55
# File 'rb/lib/selenium/webdriver/common/interactions/scroll.rb', line 47 def encode {'type' => type.to_s, 'duration' => @duration.to_i, 'x' => @x_offset, 'y' => @y_offset, 'deltaX' => @delta_x, 'deltaY' => @delta_y, 'origin' => @origin.is_a?(Element) ? @origin : @origin.to_s} end
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4