Skip to content
This repository was archived by the owner on Nov 29, 2018. It is now read-only.

Element cannot be scrolled into view:[object HTMLInputElement] #3075

Open
lukeis opened this issue Mar 3, 2016 · 31 comments
Open

Element cannot be scrolled into view:[object HTMLInputElement] #3075

lukeis opened this issue Mar 3, 2016 · 31 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 3, 2016

Originally reported on Google Code with ID 3075

Upgraded to selenium server 2.15.0. 

Tests have been working through 2.14.0. Now running the same tests give the problem
for some elements:

java.lang.AssertionError: Element cannot be scrolled into view:[URL]
Command duration or timeout: 10 milliseconds
Build info: version: '2.15.0', revision: '15105', time: '2011-12-08 09:56:25'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.6.8', java.version:
'1.6.0_26'
Driver info: driver.version: RemoteWebDriver

It seems to be an issue with the sizing of windows and elements being off the window
screen a bit but my tests require that the window size stay small to mimic mobile browsers.



Reported by iamcpizzle on 2011-12-17 00:22:42

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

My guess is the element being scrolled is a radio button? If so, this will be fixed
by 2.16.0 this week

Reported by dawagner on 2011-12-17 12:59:52

  • Status changed: Fixed

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Thanks! Waiting anxiously for 2.16.0 =)

Reported by iamcpizzle on 2011-12-27 23:41:21

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I'm getting this on a bunch of things, I don't think they're just radio buttons.  I
get it on Windows XP and OS X, but not, oddly, on Windows 7 64-bit.

Hopefully 2.16 will fix it!

Any ETA?  "This week" above was rather more than a week ago (of course, holidays, so
not complaining, just wondering).

-Robin

Reported by robinleepowell on 2012-01-03 09:12:13

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I regret to report that 2.16 doesn't fix this for us.  The following error occurs (and
many more like it) on 2.16 but *not* on 2.14:


  1) wrapper annotate conditions should re-assign files that are in the wrong tag
     Failure/Error: hover_and_move_slow( :xpath, "//span[contains(text(),\"IL-4 + IFN-g\")]",
250, 0 )
     Selenium::WebDriver::Error::WebDriverError:
       Element cannot be scrolled into view:[object HTMLSpanElement] (WARNING: The
server did not provide any stacktrace information)
       Command duration or timeout: 32 milliseconds
       Build info: version: '2.16.0', revision: '15381', time: '2012-01-04 18:45:20'
       System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.6.8', java.version:
'1.6.0_29'
       Driver info: driver.version: RemoteWebDriver (org.openqa.selenium.interactions.MoveTargetOutOfBoundsException)
     # [remote server] sun.reflect.NativeConstructorAccessorImpl(NativeConstructorAccessorImpl.java):-2:in
`newInstance0'
     # [remote server] sun.reflect.NativeConstructorAccessorImpl(NativeConstructorAccessorImpl.java):39:in
`newInstance'
     # [remote server] sun.reflect.DelegatingConstructorAccessorImpl(DelegatingConstructorAccessorImpl.java):27:in
`newInstance'
     # [remote server] java.lang.reflect.Constructor(Constructor.java):513:in `newInstance'
     # [remote server] org.openqa.selenium.remote.ErrorHandler(ErrorHandler.java):147:in
`createThrowable'
     # [remote server] org.openqa.selenium.remote.ErrorHandler(ErrorHandler.java):113:in
`throwIfResponseFailed'
     # [remote server] org.openqa.selenium.remote.RemoteWebDriver(RemoteWebDriver.java):435:in
`execute'
     # [remote server] org.openqa.selenium.remote.ExecuteMethod(ExecuteMethod.java):47:in
`execute'
     # [remote server] org.openqa.selenium.remote.RemoteMouse(RemoteMouse.java):97:in
`mouseMove'
     # [remote server] org.openqa.selenium.support.events.internal.EventFiringMouse(EventFiringMouse.java):45:in
`mouseMove'
     # [remote server] org.openqa.selenium.remote.server.handler.interactions.MouseMoveToLocation(MouseMoveToLocation.java):56:in
`call'
     # [remote server] org.openqa.selenium.remote.server.handler.interactions.MouseMoveToLocation(MouseMoveToLocation.java):1:in
`call'
     # [remote server] java.util.concurrent.FutureTask$Sync(FutureTask.java):303:in
`innerRun'
     # [remote server] java.util.concurrent.FutureTask(FutureTask.java):138:in `run'
     # [remote server] java.util.concurrent.ThreadPoolExecutor$Worker(ThreadPoolExecutor.java):886:in
`runTask'
     # [remote server] java.util.concurrent.ThreadPoolExecutor$Worker(ThreadPoolExecutor.java):908:in
`run'
     # [remote server] java.lang.Thread(Thread.java):680:in `run'
     # ./GeneralSeleniumUtility.rb:450:in `hover_and_move_slow'
     # ./tests/AnnotateConditions.rb:70

At the time it's trying to drag a jquery dragabble element.  2.14 passes the whole
test suite, so it's definitely a new/bad issue.  :(

-Robin

Reported by robinleepowell on 2012-01-05 20:53:22

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I just noticed that this is marked "fixed", which means it probably won't get any attention.
 If I don't hear anything in a day or so I'll open a new ticket.

-Robin

Reported by robinleepowell on 2012-01-05 20:54:09

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

@4: We watch all comments, and can re-open issues if they're still issues. A new issue
(or another comment on this issue) containing a minimal, complete reproduction case
(HTML, CSS, javascript, and ruby) would help us fix this problem!

Reported by dawagner on 2012-01-06 14:14:26

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Unfortunately, this only happens on my gf's machine, whether OS X or VMWare XP, and
not on mine, so (1) it's going to be a bit tricky to come up with a repro and (2) even
if I do, you might not experience; this never happens for me.

Hmm.  I wonder if it's to do with the display resolution?

Anyways, I'll see what I can come up with.

-Robin

Reported by robinleepowell on 2012-01-06 18:40:38

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

AH-HA! I've repro'd it by making my FF window really small.

Which doesn't help as it's a login-required site, but I'll see what I can do.

-Robin

Reported by robinleepowell on 2012-01-06 19:31:44

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Right, Robin - this is true for me as well. My tests are running using small sized FF
windows. My tests have run fine lately but today I got this as one of the errors. It's
not consistent so I'm not sure what other issue it could be.

The exception complains that the element I'm trying to get, which is a <td> element
with an "onclick" attribute, is not clickable. The element is supposed to act like
a radio button.


org.openqa.selenium.interactions.MoveTargetOutOfBoundsException: Element cannot be
scrolled into view:[object HTMLTableCellElement]
Command duration or timeout: 18 milliseconds
Build info: version: '2.15.0', revision: '15105', time: '2011-12-08 09:56:25'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.7.2', java.version:
'1.6.0_29'
Driver info: driver.version: RemoteWebDriver
Command duration or timeout: 671 milliseconds
Build info: version: '2.16.0', revision: '15381', time: '2012-01-04 18:45:20'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.6.8', java.version:
'1.6.0_26'
Driver info: driver.version: RemoteWebDriver
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:147)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:113)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:435)
    at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:231)
    at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:72)
    at com.ebay.mobile.test.BATtests.BATSearchTests.testSearchRefineSpecificCategory(BATSearchTests.java:234)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)


Thanks!

Reported by iamcpizzle on 2012-01-06 21:50:56

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Ugh.  It's now much worse; today my attempts to repro are being confused by a behaviour
that my gf had seen before but I hadn't, where attempts to drag are resulting in the
item getting dragged towards positive infinity in both x and y; my debugging prints
things like:

In hover_and_move_slow: moving x -35 and y -35, given current x 17895700 and y 17895700
with goals x 1028 and y 808

That's part of some Ruby that uses @driver.action.move_by(-35, -35).perform, fwiw (with
different numbers depending on where it's trying to drag to).

It's making nailing down this issue very hard, as even with a decent sized window my
tests are failing, which makes it hard to see where the problem is.  I have yet to
repro on any site less complicated than our actual website, which is so complex as
to be useless for repro purposes.

This turns out to *ALSO* be a window size issue: if I maximize right after Selenium
opens FF, the issue goes away.

So if the window is *really* small, I get the "cannot be scrolled into view", if it's
sort of medium-sized, I get "drag to infinity weeeee!", if it's really big (1920x1200
is my full screen size) everything is fine.

I *think* it's something to do with how far off the screen the element is when Selenium
first tries to click on it.

I may be able to repro "drag to infinity weee!" more easily than the other.  Still
trying.

-Robin

Reported by robinleepowell on 2012-01-06 22:32:48

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

OK, I now know why it's broken today when it wasn't yesterday, but it makes the whole
issue take on Twilight Zone qualities.

As explained in http://code.google.com/p/selenium/issues/detail?id=3154 , yesterday
I replaced this code:


      @driver = Selenium::WebDriver.for( :remote,  :url => "http://localhost:#{@port}/wd/hub",
                                        :desired_capabilities => @browser.to_sym )

with this code:


      @debug and print "I THINK I AM FIREFOX\n"
      profile = Selenium::WebDriver::Firefox::Profile.new
      # See http://code.google.com/p/selenium/issues/detail?id=3154
#      profile['toolkit.telemetry.prompted'] = 2
#      profile['toolkit.telemetry.rejected'] = true

      caps = Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile =>
profile)
      @driver = Selenium::WebDriver.for( :remote,  :url => "http://localhost:#{@port}/wd/hub",
                                        :desired_capabilities => caps)

because if I do that, Selenium can actually click things.

If I revert that change, go back to the one that hasn't rolled its own FireFox profile,
and also click "No" in the "would you like to help mozilla?" window very fast so that
clicks work, *then* everything is fine.

At a *guess*, the default profile that Selenium and/or selenium-webdriver (the Ruby
binding) creates has options set that my empty profile does not.  I'll see if I can
verify that.

-Robin

Reported by robinleepowell on 2012-01-07 02:11:28

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Yep, confirmed; the issue is that an empty profile was turning off native events.

*facepalm*

This "works":


      @debug and print "I THINK I AM FIREFOX\n"
      profile = Selenium::WebDriver::Firefox::Profile.new
      print "profile: #{profile.inspect}\n"
      # See http://code.google.com/p/selenium/issues/detail?id=3154
      profile['toolkit.telemetry.prompted'] = '2'
      profile['toolkit.telemetry.rejected'] = 'true'
      profile.native_events = true
      print "profile: #{profile.inspect}\n"

      caps = Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile =>
profile,
                                                               :browser_name      
   => "firefox",
                                                               :javascript_enabled
   => true,
                                                               :takes_screenshot  
   => true,
                                                               :css_selectors_enabled
=> true,
                                                               :native_events     
   => true
                                                              )
      @driver = Selenium::WebDriver.for( :remote,  :url => "http://localhost:#{@port}/wd/hub",
                                        :desired_capabilities => caps)

If the "profile.native_events = true" line is commented out, it fails.  That's a bug
in the Ruby drivers, IMO, and I'll make one for that.

I say "works" in scare quotes because at that point I'm back to issues 3154: I have
to manually click the telemetry message or native-event clicks don't work.

Something in the WebDriver border that shows if you're in native event mode would have
made this a lot easier to deal with.

So, *in native event mode*, I can't repro this issue anymore.  I'll check with my gf
on her computer as soon as I can.

-Robin

Reported by robinleepowell on 2012-01-07 02:52:28

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

So, if I force native events, yeah, I can't make this happen.

But OS X doesn't seem to *have* native events; it just errors out when it tries to
do mouse movement.

But it works with 2.14.

So, something changed in the non-native event handling.

Can y'all let me know if there's a way to make native events work under OS X?

I can't seem to make a minimal test case, but if one of you wants to contact me privately
(rlpowell@digitalkingdom.org) I could get you temporary access to our site so you can
see this issue(s).

Or, if the person @comment 9 can reliably repro on a public site, tell us how?

Also, I don't think this bug should be in Fixed state.  :)

-Robin

Reported by robinleepowell on 2012-01-07 09:44:24

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

OH MY GOD THAT WAS A PIT OF HORROR.  But I have a complete repro.

OK, so.  I spent much of a day trying to repro it and I couldn't because the changes
I had made to the main code had the profile, which caused native events to be turned
off, weren't in the much smaller code I use for repro testing.

-_-

So, here's code that causes this issue every time.  If you turn native events on, the
problem goes away on Windows 7, but remains on OS X, so I guess there's no native events
there.

This problem occurs on 2.15, but not 2.14.

If it doesn't repro, make the window smaller after it opens.

The HTML that I'm hosting that it runs against is probably larger than it needs to
be, but basically it's just the jquery "sortable" module.

Note, though, that non-native events with 2.14 don't actually *WORK* at all; the item
does not in fact end up in the place it is supposed to end up.  Let me know if I should
open a new ticket for that.  The second code paste below is a very simple test that
should end up with Item 10 moved up a few lines, but in fact it just snaps back.


- ---------------------



require 'rubygems'
gem 'selenium-webdriver'
require "selenium-webdriver"

profile = Selenium::WebDriver::Firefox::Profile.new

# DISABLE NATIVE EVENTS
profile.native_events = false

caps = Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile => profile,
                                                         :browser_name          =>
"firefox",
                                                         :javascript_enabled    =>
true,
                                                         :takes_screenshot      =>
true,
                                                         :css_selectors_enabled =>
true,
                                                         # DISABLE NATIVE EVENTS
                                                         :native_events         =>
false)


@driver = Selenium::WebDriver.for( :remote,  :url => "http://localhost:#{ARGV[0]}/wd/hub",
:desired_capabilities => caps)


@driver.manage.timeouts.implicit_wait = 5 # seconds

@driver.navigate.to "http://users.digitalkingdom.org/~rlpowell/media/public/selenium-test/jqs.html"
e=@driver.find_element(:xpath, "//li[contains(text(),'Item 3-70')]" )
sleep 1
print "info: #{e.location.x}, #{e.location.y}\n"
@driver.action.click_and_hold(e).perform;
sleep 1
print "moving\n"
@driver.action.move_by(0, -50).perform;
sleep 1
print "info: #{e.location.x}, #{e.location.y}\n"
@driver.action.move_by(0, -50).perform;
print "info: #{e.location.x}, #{e.location.y}\n"
@driver.action.move_by(0, -50).perform;
print "info: #{e.location.x}, #{e.location.y}\n"
@driver.action.move_by(0, -50).perform;
print "info: #{e.location.x}, #{e.location.y}\n"
sleep 1
@driver.action.release.perform;
print "released\n"
sleep 20
@driver.action.click_and_hold(e).perform;
@driver.action.move_by(0, 50).perform;
print "info: #{e.location.x}, #{e.location.y}\n"
sleep 1
@driver.action.move_by(0, 50).perform;
print "info: #{e.location.x}, #{e.location.y}\n"
sleep 1
@driver.quit
exit 1

- ------------------


require 'rubygems'
gem 'selenium-webdriver'
require "selenium-webdriver"

profile = Selenium::WebDriver::Firefox::Profile.new

# DISABLE NATIVE EVENTS
profile.native_events = false

caps = Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile => profile,
                                                         :browser_name          =>
"firefox",
                                                         :javascript_enabled    =>
true,
                                                         :takes_screenshot      =>
true,
                                                         :css_selectors_enabled =>
true,
                                                         # DISABLE NATIVE EVENTS
                                                         :native_events         =>
false)


@driver = Selenium::WebDriver.for( :remote,  :url => "http://localhost:#{ARGV[0]}/wd/hub",
:desired_capabilities => caps)


@driver.manage.timeouts.implicit_wait = 5 # seconds

@driver.navigate.to "http://users.digitalkingdom.org/~rlpowell/media/public/selenium-test/jqs.html"
e=@driver.find_element(:xpath, "//li[contains(text(),'Item 10')]" )
sleep 1
print "info: #{e.location.x}, #{e.location.y}\n"
@driver.action.click_and_hold(e).perform;
sleep 1
print "moving\n"
@driver.action.move_by(0, -50).perform;
sleep 1
print "info: #{e.location.x}, #{e.location.y}\n"
@driver.action.move_by(0, -50).perform;
print "info: #{e.location.x}, #{e.location.y}\n"
@driver.action.move_by(0, -50).perform;
print "info: #{e.location.x}, #{e.location.y}\n"
@driver.action.move_by(0, -50).perform;
print "info: #{e.location.x}, #{e.location.y}\n"
sleep 1
@driver.action.release.perform;
print "released\n"
sleep 20
@driver.quit
exit 1

- --------------

-Robin

Reported by robinleepowell on 2012-01-08 02:02:46

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Thank you all for working on this issue.

Using watir-webdriver, I was running into this issue today.  I upgraded to Selenium
version 2.16 and the issue disappeared, without using the code above.  Perhaps someone
has fixed it and simply forgot to post their comment?

Reported by fulvius on 2012-01-08 02:09:14

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Nope, it's 2.16 I've been primarily testing against, and I just checked and my repro
code does this with 2.16; I just did 2.15 to show that it's a 2.14->2.15 bug, to make
it easier to find.


[rlpowell@qa01 weird]$ rlwrap ruby dragtest_wide.rb 7444 firefox
info: 1743, 2390
[remote server] sun.reflect.NativeConstructorAccessorImpl():-2:in `newInstance0': Element
cannot be scrolled into view:[object HTMLLIElement] (WARNING: The server did not provide
any stacktrace information) (Selenium::WebDriver::Error::MoveTargetOutOfBoundsError)
Command duration or timeout: 10 milliseconds
Build info: version: '2.16.0', revision: '15381', time: '2012-01-04 18:45:20'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version:
'1.6.0_26'
Driver info: driver.version: RemoteWebDriver (org.openqa.selenium.interactions.MoveTargetOutOfBoundsException)
        from [remote server] sun.reflect.NativeConstructorAccessorImpl():-1:in `newInstance'
        from [remote server] sun.reflect.DelegatingConstructorAccessorImpl():-1:in
`newInstance'
        from [remote server] java.lang.reflect.Constructor():-1:in `newInstance'
        from [remote server] org.openqa.selenium.remote.ErrorHandler(ErrorHandler.java):147:in
`createThrowable'
        from [remote server] org.openqa.selenium.remote.ErrorHandler(ErrorHandler.java):113:in
`throwIfResponseFailed'
        from [remote server] org.openqa.selenium.remote.RemoteWebDriver(RemoteWebDriver.java):435:in
`execute'
        from [remote server] org.openqa.selenium.remote.ExecuteMethod(ExecuteMethod.java):47:in
`execute'
        from [remote server] org.openqa.selenium.remote.RemoteMouse(RemoteMouse.java):89:in
`mouseMove'
        from [remote server] org.openqa.selenium.support.events.internal.EventFiringMouse(EventFiringMouse.java):41:in
`mouseMove'
        from [remote server] org.openqa.selenium.remote.server.handler.interactions.MouseMoveToLocation(MouseMoveToLocation.java):58:in
`call'
        from [remote server] org.openqa.selenium.remote.server.handler.interactions.MouseMoveToLocation(MouseMoveToLocation.java):1:in
`call'
        from [remote server] java.util.concurrent.FutureTask$Sync():-1:in `innerRun'
        from [remote server] java.util.concurrent.FutureTask():-1:in `run'
        from [remote server] java.util.concurrent.ThreadPoolExecutor$Worker():-1:in
`runTask'
        from [remote server] java.util.concurrent.ThreadPoolExecutor$Worker():-1:in
`run'
        from [remote server] java.lang.Thread():-1:in `run'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/response.rb:52:in
`assert_ok'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/response.rb:15:in
`initialize'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/http/common.rb:59:in
`new'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/http/common.rb:59:in
`create_response'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/http/default.rb:64:in
`request'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/http/common.rb:40:in
`call'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/bridge.rb:454:in
`raw_execute'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/bridge.rb:432:in
`execute'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/bridge.rb:294:in
`mouseMoveTo'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/mouse.rb:50:in
`move_to'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/mouse.rb:60:in
`move_if_needed'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/mouse.rb:27:in
`down'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/action_builder.rb:344:in
`__send__'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/action_builder.rb:344:in
`perform'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/action_builder.rb:343:in
`each'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/action_builder.rb:343:in
`perform'
        from dragtest_wide.rb:28

Reported by robinleepowell on 2012-01-08 02:12:24

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I see this in the changelog for 2.16: "Native events enabled for Firefox 9" .. I am
testing in Firefox 9 on OSX, and this change between 2.15 and 2.16 seems to have completely
fixed the issue for me.  Robin on behalf of the Selenium user community, I thank you
again for your hard work on this.  Please let me know if you'd like any assistance
testing in OSX tonight or tomorrow at: fulvius@gmail.com

Reported by fulvius on 2012-01-08 02:13:39

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

So, there are two issues here, which I will address separately.  First, the one that's
trivial to test:

Issue 1: Does FF9 on OSX support native events?

The answer is no, not for me on my gf's Mac (I don't own one myself).

The following is code run against OS X 10.6.8, FF 9.0.1, with 2.16, first with native
events on, second with them off.  The code is below the output.

- --------------------

[rlpowell@qa01 weird]$ rlwrap ruby dragtest_wide.rb 8444 ffnonative
info: 1743, 2390
[remote server] sun.reflect.NativeConstructorAccessorImpl(NativeConstructorAccessorImpl.java):-2:in
`newInstance0': Element cannot be scrolled into view:[object HTMLLIElement] (WARNING:
The server did not provide any stacktrace information) (Selenium::WebDriver::Error::MoveTargetOutOfBoundsError)
Command duration or timeout: 20 milliseconds
Build info: version: '2.16.0', revision: '15381', time: '2012-01-04 18:45:20'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.6.8', java.version:
'1.6.0_29'
Driver info: driver.version: RemoteWebDriver (org.openqa.selenium.interactions.MoveTargetOutOfBoundsException)
        from [remote server] sun.reflect.NativeConstructorAccessorImpl(NativeConstructorAccessorImpl.java):39:in
`newInstance'
        from [remote server] sun.reflect.DelegatingConstructorAccessorImpl(DelegatingConstructorAccessorImpl.java):27:in
`newInstance'
        from [remote server] java.lang.reflect.Constructor(Constructor.java):513:in
`newInstance'
        from [remote server] org.openqa.selenium.remote.ErrorHandler(ErrorHandler.java):147:in
`createThrowable'
        from [remote server] org.openqa.selenium.remote.ErrorHandler(ErrorHandler.java):113:in
`throwIfResponseFailed'
        from [remote server] org.openqa.selenium.remote.RemoteWebDriver(RemoteWebDriver.java):435:in
`execute'
        from [remote server] org.openqa.selenium.remote.ExecuteMethod(ExecuteMethod.java):47:in
`execute'
        from [remote server] org.openqa.selenium.remote.RemoteMouse(RemoteMouse.java):89:in
`mouseMove'
        from [remote server] org.openqa.selenium.support.events.internal.EventFiringMouse(EventFiringMouse.java):41:in
`mouseMove'
        from [remote server] org.openqa.selenium.remote.server.handler.interactions.MouseMoveToLocation(MouseMoveToLocation.java):58:in
`call'
        from [remote server] org.openqa.selenium.remote.server.handler.interactions.MouseMoveToLocation(MouseMoveToLocation.java):1:in
`call'
        from [remote server] java.util.concurrent.FutureTask$Sync(FutureTask.java):303:in
`innerRun'
        from [remote server] java.util.concurrent.FutureTask(FutureTask.java):138:in
`run'
        from [remote server] java.util.concurrent.ThreadPoolExecutor$Worker(ThreadPoolExecutor.java):886:in
`runTask'
        from [remote server] java.util.concurrent.ThreadPoolExecutor$Worker(ThreadPoolExecutor.java):908:in
`run'
        from [remote server] java.lang.Thread(Thread.java):680:in `run'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/response.rb:52:in
`assert_ok'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/response.rb:15:in
`initialize'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/http/common.rb:59:in
`new'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/http/common.rb:59:in
`create_response'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/http/default.rb:64:in
`request'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/http/common.rb:40:in
`call'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/bridge.rb:454:in
`raw_execute'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/bridge.rb:432:in
`execute'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/bridge.rb:294:in
`mouseMoveTo'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/mouse.rb:50:in
`move_to'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/mouse.rb:60:in
`move_if_needed'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/mouse.rb:27:in
`down'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/action_builder.rb:344:in
`__send__'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/action_builder.rb:344:in
`perform'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/action_builder.rb:343:in
`each'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/action_builder.rb:343:in
`perform'
        from dragtest_wide.rb:48

- --------------------

[rlpowell@qa01 weird]$ rlwrap ruby dragtest_wide.rb 8444 ffnative
info: 1743, 2390
[remote server] sun.reflect.NativeConstructorAccessorImpl(NativeConstructorAccessorImpl.java):-2:in
`newInstance0': Cannot perform native interaction: Could not load native events component.
(Selenium::WebDriver::Error::InvalidElementStateError)
Command duration or timeout: 5.02 seconds
Build info: version: '2.16.0', revision: '15381', time: '2012-01-04 18:45:20'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.6.8', java.version:
'1.6.0_29'
Driver info: driver.version: RemoteWebDriver (org.openqa.selenium.InvalidElementStateException)
        from [remote server] sun.reflect.NativeConstructorAccessorImpl(NativeConstructorAccessorImpl.java):39:in
`newInstance'
        from [remote server] sun.reflect.DelegatingConstructorAccessorImpl(DelegatingConstructorAccessorImpl.java):27:in
`newInstance'
        from [remote server] java.lang.reflect.Constructor(Constructor.java):513:in
`newInstance'
        from [remote server] org.openqa.selenium.remote.ErrorHandler(ErrorHandler.java):147:in
`createThrowable'
        from [remote server] org.openqa.selenium.remote.ErrorHandler(ErrorHandler.java):113:in
`throwIfResponseFailed'
        from [remote server] org.openqa.selenium.remote.RemoteWebDriver(RemoteWebDriver.java):435:in
`execute'
        from [remote server] org.openqa.selenium.remote.ExecuteMethod(ExecuteMethod.java):47:in
`execute'
        from [remote server] org.openqa.selenium.remote.RemoteMouse(RemoteMouse.java):89:in
`mouseMove'
        from [remote server] org.openqa.selenium.support.events.internal.EventFiringMouse(EventFiringMouse.java):41:in
`mouseMove'
        from [remote server] org.openqa.selenium.remote.server.handler.interactions.MouseMoveToLocation(MouseMoveToLocation.java):58:in
`call'
        from [remote server] org.openqa.selenium.remote.server.handler.interactions.MouseMoveToLocation(MouseMoveToLocation.java):1:in
`call'
        from [remote server] java.util.concurrent.FutureTask$Sync(FutureTask.java):303:in
`innerRun'
        from [remote server] java.util.concurrent.FutureTask(FutureTask.java):138:in
`run'
        from [remote server] java.util.concurrent.ThreadPoolExecutor$Worker(ThreadPoolExecutor.java):886:in
`runTask'
        from [remote server] java.util.concurrent.ThreadPoolExecutor$Worker(ThreadPoolExecutor.java):908:in
`run'
        from [remote server] java.lang.Thread(Thread.java):680:in `run'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/response.rb:52:in
`assert_ok'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/response.rb:15:in
`initialize'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/http/common.rb:59:in
`new'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/http/common.rb:59:in
`create_response'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/http/default.rb:64:in
`request'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/http/common.rb:40:in
`call'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/bridge.rb:454:in
`raw_execute'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/bridge.rb:432:in
`execute'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/remote/bridge.rb:294:in
`mouseMoveTo'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/mouse.rb:50:in
`move_to'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/mouse.rb:60:in
`move_if_needed'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/mouse.rb:27:in
`down'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/action_builder.rb:344:in
`__send__'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/action_builder.rb:344:in
`perform'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/action_builder.rb:343:in
`each'
        from /opt/common/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/selenium-webdriver-2.16.0/lib/selenium/webdriver/common/action_builder.rb:343:in
`perform'
        from dragtest_wide.rb:48


- --------------------


[rlpowell@qa01 weird]$ cat dragtest_wide.rb
require 'rubygems'
gem 'selenium-webdriver'
require "selenium-webdriver"

if ARGV[1] == 'ffnative'
  profile = Selenium::WebDriver::Firefox::Profile.new

  # ENABLE NATIVE EVENTS
  profile.native_events = true

  caps = Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile => profile,
                                                           :browser_name          =>
"firefox",
                                                           :javascript_enabled    =>
true,
                                                           :takes_screenshot      =>
true,
                                                           :css_selectors_enabled =>
true,
                                                           # ENABLE NATIVE EVENTS
                                                           :native_events         =>
true)

elsif ARGV[1] == 'ffnonative'
  profile = Selenium::WebDriver::Firefox::Profile.new

  # DISABLE NATIVE EVENTS
  profile.native_events = false

  caps = Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile => profile,
                                                           :browser_name          =>
"firefox",
                                                           :javascript_enabled    =>
true,
                                                           :takes_screenshot      =>
true,
                                                           :css_selectors_enabled =>
true,
                                                           # DISABLE NATIVE EVENTS
                                                           :native_events         =>
false)


else
  print "pick one\n"
  exit 1
end

@driver = Selenium::WebDriver.for( :remote,  :url => "http://localhost:#{ARGV[0]}/wd/hub",
:desired_capabilities => caps)


@driver.manage.timeouts.implicit_wait = 5 # seconds

@driver.navigate.to "http://users.digitalkingdom.org/~rlpowell/media/public/selenium-test/jqs.html"
e=@driver.find_element(:xpath, "//li[contains(text(),'Item 3-70')]" )
sleep 1
print "info: #{e.location.x}, #{e.location.y}\n"
@driver.action.click_and_hold(e).perform;
sleep 1
print "moving\n"
@driver.action.move_by(0, -50).perform;
sleep 1
print "info: #{e.location.x}, #{e.location.y}\n"
@driver.action.move_by(0, -50).perform;
print "info: #{e.location.x}, #{e.location.y}\n"
@driver.action.move_by(0, -50).perform;
print "info: #{e.location.x}, #{e.location.y}\n"
@driver.action.move_by(0, -50).perform;
print "info: #{e.location.x}, #{e.location.y}\n"
sleep 1
@driver.action.release.perform;
print "released\n"
sleep 20
@driver.action.click_and_hold(e).perform;
@driver.action.move_by(0, 50).perform;
print "info: #{e.location.x}, #{e.location.y}\n"
sleep 1
@driver.action.move_by(0, 50).perform;
print "info: #{e.location.x}, #{e.location.y}\n"
sleep 1
@driver.quit
exit 1

Reported by robinleepowell on 2012-01-08 21:19:25

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Issue 2: Whether this is an acceptable regression.

Comment 17 seems to imply that breaking non-native events is OK because native events
are working now.  This isn't actually true for me, but even if it was: how is breaking
things *good*?

I *just* ran our full test suite, on the same machine as my previous comment, with
2.14, and it works perfectly, start to finish.  This thing is *huge*; hundreds upon
hundreds of Selenium commands, much of it involving dragging things around the screen.
 In 2.14 it *works* with non-native events.  In 2.16 it doesn't.  How is that possibly
OK?

-Robin

Reported by robinleepowell on 2012-01-08 21:53:24

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I'm working with Robin offline to sort out this issue.  Thank you Robin very much for
both the repro case above, and your offers of help - I haven't tried the repro out
yet, but I'll give it a go as soon as I have some time.

To address a few comments:

1) There are no native events on Mac at the moment.
2) Breaking either of native or non-native events isn't ok - definitely a bug.

Reported by dawagner on 2012-01-09 17:28:21

  • Status changed: Accepted
  • Labels added: Component-WebDriver, Browser-Firefox

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Hi,

I have this very same problem (Element cannot be scrolled into view) when trying to
hover to open a dropdown menu in Firefox 2.17, but not in Firefox 2.14. On chrome the
driver (2.14 and 2.17) does not complain on hovering, but dropdown menu is not revealed
so the following click fails, which it does not on Firefox 2.14.
OS: Ubuntu 11.10 64-bit.

Reported by andreas.brudin on 2012-01-27 12:00:46

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I believe that Daniel is actively working on this, and I gather it turns out to be rather
complicated in the code, so we may be waiting a bit.

-Robin

Reported by robinleepowell on 2012-01-27 18:50:27

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Broken also in 2.18

Reported by andreas.brudin on 2012-01-31 20:34:18

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Hi, 
I had to put lots of my tests to ignore due to it :( 
any hope to see it fixed in next version ?

I have this issue with 2.18 C# at IE9, Win7

Reported by TSuhachev on 2012-02-08 16:01:33

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Broken in 2.19

Reported by aroehler on 2012-02-09 15:51:52

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Broken in 2.19  +1

com.thoughtworks.selenium.SeleniumException: Element cannot be scrolled into view:[object
HTMLDivElement]
Command duration or timeout: 4 milliseconds
Build info: version: '2.19.0', revision: '15849', time: '2012-02-08 16:12:19'
System info: os.name: 'Windows Server 2008 R2', os.arch: 'x86', os.version: '6.1',
java.version: '1.6.0_21'
Driver info: driver.version: RemoteWebDriver

Reported by kasheylm on 2012-02-10 18:28:21

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

We know this is broken, we hope to have it fixed soon, restricting comments because
of all the +1 comments.

Reported by dawagner on 2012-02-10 23:24:53

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Yet another repro case: http://stackoverflow.com/questions/9270259/seleniumwebdrivererrormovetargetoutofboundserror-element-cannot-be-scroll

Reported by dawagner on 2012-02-14 16:27:45

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Issue 3655 has been merged into this issue.

Reported by jari.bakken on 2012-04-05 11:32:42

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Here's the test case for this in watirspec:

 https://github.com/watir/watirspec/blob/837a2c3/html/drag_and_drop.html
 https://github.com/watir/watirspec/blob/837a2c3/drag_and_drop_spec.rb#L17

Reported by jari.bakken on 2012-08-03 18:33:54

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

There's a regression in 2.36, where this happens not only when the *draggable* is outside
the viewport, but also when the *droppable* is outside the viewport. Attached is a
pure WebDriver Ruby script that demonstrates the problem (taken from watirspec linked
above).








Reported by jari.bakken on 2014-01-08 18:34:26


- _Attachment: [test.rb](https://storage.googleapis.com/google-code-attachments/selenium/issue-3075/comment-33/test.rb)_

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant