How do I use the Selenium Nodes to scroll the browser window and ensure an element is visible?
I often encounter the Selenium error "Element is not clickable at point(x,y). Other element would receive the click".
Some research suggests that I first need to ensure that the element is visible on the screen before it can be clicked. The sample JavaScript I've found looks like this:
When you set up the Execute JavaScript node correctly, it should be as easy as:
arguments[0].scrollIntoView();
arguments[0] is the element which should be scrolled into the view. You can retrieve it using the Find Elements node and then pass it as argument into the Execute JavaScript by selecting it in the left "Arguments" column:
(a bit further explanation: all arguments which you select in this column are passed into the arguments array, so the first selected item is available as arguments[0], the second as arguments[1], etc.)
I'm attaching a sample workflow which scrolls the KNIME forum's footer into the browser view.
Hope this helps.
[edit] Will probably provide the "scroll into view" functionality as a dedicated node in the future. Thanks for the pointer!
[edit2] This also worko, but note that the scrollTo function is written with a lowercase s: