1

I'm running into the following error with Watir using Chrome Driver;

WARN: Selenium::WebDriver::Error::UnknownError: unknown error: Element is not clickable at point (762, 711)

I know the element is on the page, but it seems the element is just below the bottom of ChromeDriver viewport and needs to be scrolled to to be visible, in the size viewport that I see on my screen at least.

This is a related SO question, though I can't find a Ruby soution, can anyone advise. Thanks

jbk
  • 1,911
  • 19
  • 36

2 Answers2

3

Make sure you're using the latest chromedriver (2.33). There was a change in how scrolling worked with Chrome 61 and I think the fix was first available in chromedriver 2.32.

Lucas Tierney
  • 2,503
  • 15
  • 13
  • Thanks @lucas-tierney, I couldn't find command for brew updating homebrew so I brew uninstalled, and 'brew install homebrew'ed again and all is now well. – jbk Oct 19 '17 at 05:01
0

One way is to use scrollIntoView (assuming the element is the button):

browser.execute_script('arguments[0].scrollIntoView();', browser.button(id: testBTN))

Another way is an answer by Justin Ko:

Element is not clickable error Ruby / Watir

Andrey
  • 1,808
  • 1
  • 16
  • 28