0

Is it possible to scroll to an element with FluentAutomation + Selenium, e.g. to click a button outside of the currently visible area? If so, how?

From browsing the FluentAutomation docs, I can't see any support for this. The problem is that if an element is outside the currently visible area, it can't be interacted with (e.g. clicked) via FluentAutomation.

stirno
  • 598
  • 4
  • 10
aknuds1
  • 65,625
  • 67
  • 195
  • 317

1 Answers1

1

Use I.Hover(selector) to cause an element to scroll into view. Selenium implicitly handles managing the viewport via what the test is touching.

stirno
  • 598
  • 4
  • 10
  • I should also note, that the dev version of FluentAutomation should no longer suffer from the 'Element not visible' errors as we have switched our underlying method of clicking items. This should mean you won't have to take 2 steps if ultimately your goal is to click the thing that is not visible. – stirno May 05 '13 at 14:48
  • Also added, in dev branch, syntactical sugar to provider an alias for I.Scroll -> I.Hover as the internal implementations would be identical. – stirno May 05 '13 at 14:57
  • Automatic scrolling upon click sounds excellent, is this how the raw Selenium Webdriver API handles it as well? – aknuds1 May 05 '13 at 18:02
  • Only if you use the Actions API to trigger the click. – stirno May 05 '13 at 19:34