0

It worked until today, no code got changed So if I do something like

page.find('#edit-user').native.send_keys(:tab, :tab) it's not working (it's highlighting the element #edit-user but not moving forward) specifically for the tab key, it's working correctly for :space or :enter.

It was working previously, it's a small possibility that it's related to some settings change for the Chrome browser but not sure exactly how and why

infused
  • 24,000
  • 13
  • 68
  • 78
Tamara Sk
  • 15
  • 4
  • Please, do not suggest using other solutions that :tab, it's would be inefficient to switch right now considering large number of tests using it and limited time. – Tamara Sk Jul 22 '15 at 23:13
  • [chrome](https://en.wikipedia.org/wiki/Google_Chrome_release_history) did release version 44.0.2403 on 2015-07-21. – orde Jul 23 '15 at 01:09
  • chrome updates updates roughly every month or two (although that's not written in stone). AFAIK, there's no official rollback procedure for chrome aside from uninstalling and reinstalling, which assumes you can find the installer for the browser version that you want. – orde Jul 23 '15 at 04:10
  • what version of chromedriver are you using? – Thomas Walpole Jul 23 '15 at 17:31
  • chromedriver: stable 2.10 – Tamara Sk Jul 23 '15 at 18:44

1 Answers1

0

We are having this problem in Chrome as well, and it all started with Chrome update 44.

I tried using "\t", :tab, :return, :enter, and :escape to remove focus from a text input (symbols found here), but none of them are working in the most recent version of Chrome.

I know you mentioned you are not looking for solutions other than tab, but short of rolling back your browser version and disabling updates, or waiting for the possibility of a fix from Google itself, you will have to change the scripts being executed.

We found that this has worked well so far: driver.execute_script("document.activeElement.blur()")

If the desired behavior in your case is to shift focus two fields forward, then you might consider another Javascript solution that looks something like what is discussed in this thread: simulate the tab key function in javascript

Of course, this probably isn't the best long term solution, as even some very quick Googling shows that sending a tab key to switch focus has been recommended tons of times to people using WebDriver. Because of this, I'm keeping my fingers crossed there will be another Chrome update to revert the behavior.

Community
  • 1
  • 1
cjmccann
  • 16
  • 2