Module: OnlyofficeWebdriverWrapper::ScrollMethods
- Included in:
- WebDriver
- Defined in:
- lib/onlyoffice_webdriver_wrapper/webdriver/scroll_methods.rb
Overview
Methods for scrolling page
Instance Method Summary collapse
-
#current_scroll_position(xpath) ⇒ Float
Get current element scroll position.
-
#scroll_list_by_pixels(list_xpath, pixels) ⇒ void
Scroll list by pixel count.
Instance Method Details
#current_scroll_position(xpath) ⇒ Float
Get current element scroll position
18 19 20 |
# File 'lib/onlyoffice_webdriver_wrapper/webdriver/scroll_methods.rb', line 18 def current_scroll_position(xpath) execute_javascript("return $(#{dom_element_by_xpath(xpath)}).scrollTop()") end |
#scroll_list_by_pixels(list_xpath, pixels) ⇒ void
This method returns an undefined value.
Scroll list by pixel count
10 11 12 13 |
# File 'lib/onlyoffice_webdriver_wrapper/webdriver/scroll_methods.rb', line 10 def scroll_list_by_pixels(list_xpath, pixels) element = dom_element_by_xpath(list_xpath) execute_javascript("$(#{element}).scrollTop(#{pixels})") end |