Skip to content

Instantly share code, notes, and snippets.

@Tset-Noitamotua
Created June 27, 2017 11:22
Show Gist options
  • Save Tset-Noitamotua/c3ddb211725fe391ef4dc0bd85d700cc to your computer and use it in GitHub Desktop.
Save Tset-Noitamotua/c3ddb211725fe391ef4dc0bd85d700cc to your computer and use it in GitHub Desktop.
Collection of usefull shit for S2L

S2L Custom Keywords

Collection of usefull stuff (mainly custom keywords) for RF S2L

Scroll To Div by ID
[Documentation] TODO make it work and finish it
...
execute javascript var element = document.getElementById("s_vctrl_div"); element.scrollIntoView();
Scroll To Bottom
[Documentation] author: glmeece (RF Slack)
...
Execute JavaScript window.scrollTo(0, document.body.scrollHeight)
Sleep 2
Scroll to Element
[Documentation] Pass in a recognizable element selector; this keyword
... will scroll the pane to make it the top-most element.
... Optionally, change the ``vert_offset`` to another value
... to control how far "back" you want to scroll from the
... element (allows you to see elements above the element).
... author: glmeece (RF Slack)
...
[Arguments] ${the_element} ${vert_offset}=${23}
Wait Until Page Contains Element ${the_element} timeout=5 seconds error=*HTML* <span style="color:red;font-weight:bold">φ</span> Scroll to Element:: unable to locate the element '${the_element}'
${vert_pos} = Get Vertical Position ${the_element}
${horz_pos} = Get Horizontal Position ${the_element}
Execute JavaScript window.scrollTo(${horz_pos},${vert_pos} - ${vert_offset})
Sleep .25 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment