Auto-scroll in FireFox is not working

194 views
Skip to first unread message

Rob Bovill

unread,
Jul 30, 2013, 7:18:06 PM7/30/13
to robotframe...@googlegroups.com
     I am having trouble with auto-scrolling in FireFox.  We're testing a GWT/GXT application using selenium2library.  Our application has embedded lists and if one of the elements is not visible, then Click Element returns the error:

ElementNotVisibleException: Message: u'Element is not currently visible and so may not be interacted with' ; Stacktrace: 
    at fxdriver.preconditions.visible (file:///var/folders/qk/6n3ttg097wlc9sqyrcw0q5fh0000gp/T/tmp7kn5tj/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/command_processor.js:7736)
    at DelayedCommand.prototype.checkPreconditions_ (file:///var/folders/qk/6n3ttg097wlc9sqyrcw0q5fh0000gp/T/tmp7kn5tj/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/command_processor.js:10437)
    at DelayedCommand.prototype.executeInternal_/h (file:///var/folders/qk/6n3ttg097wlc9sqyrcw0q5fh0000gp/T/tmp7kn5tj/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/command_processor.js:10456)
    at DelayedCommand.prototype.executeInternal_ (file:///var/folders/qk/6n3ttg097wlc9sqyrcw0q5fh0000gp/T/tmp7kn5tj/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/command_processor.js:10461)
    at DelayedCommand.prototype.execute/< (file:///var/folders/qk/6n3ttg097wlc9sqyrcw0q5fh0000gp/T/tmp7kn5tj/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/command_processor.js:10401)

This is only happening in FireFox.  The same tests in Chrome work like a charm.

I dummied up a simple test case that demonstrates the error.  This test uses the sencha.com/examples site, from which we get the templates we use in our application.

*** Settings ***
Documentation     This is a test suite. 
Suite Teardown    Close All Browsers
Test Timeout      1 minute
Library           Selenium2Library    5s    run_on_failure=Capture Page Screenshot

*** Test Cases ***
Test1
    Open Browser    http://www.sencha.com/examples/    firefox
    Maximize Browser Window
    Comment    Expand tree items.
    Click Element    xpath=//span[text()='Windows']/../img[2]
    Click Element    xpath=//span[text()='TreeGrid']/../img[2]
    Click Element    xpath=//span[text()='Tree']/../img[2]
    Click Element    xpath=//span[text()='ToolBar & Menu']/../img[2]
    Click Element    xpath=//span[text()='Templates & Lists']/../img[2]
    Click Element    xpath=//span[text()='Tabs']/../img[2]
    Click Element    xpath=//span[text()='Misc']/../img[2]
    Wait Until Page Contains Element    xpath=//span[text()="MessageBox"]    30s
    Click Element    //span[text()="MessageBox"]
    Capture Page Screenshot
    Sleep    5s


I'm pretty sure this is a problem with Selenium and the WebDriver.  I tried using SeleniumIDE in FireFox to test this, and while I'm not getting the error, Selenium is not selecting the items.

Has anyone else had this problem?  Any workarounds?

Thanks,

Rob

Kevin O.

unread,
Jul 31, 2013, 10:09:43 AM7/31/13
to robotframe...@googlegroups.com
I would try to determine exactly which element Se is trying to click on - it may not be what you expect.
With GMail (also GWT), I saw invisible copies of elements that appeared earlier in the DOM and got this same error. See https://groups.google.com/forum/?fromgroups#!searchin/robotframework-users/gmail/robotframework-users/Em1eUR08vMo/AE7sJU9TwNcJ.
It is unlikely but possible that Webdriver executing the next click before the JS has made the element visible.  Adding  implicit_wait=2.0 to Import Browser would rule this out (although some consider this a bad practice it is certainly OK for troubleshooting).
Unfortunately your test passes on my machine :(
Using Se 2.31.0, FF 17.0.7 (ESR), S2Lib 1.2, 32-bit Python 2.7.3 on Windows 7 64-bit.
The error your getting indicates that Webdriver determined that the element was logically not visible when you tried to click on it.
This is different from a similar error that your post title hints at: ElementNotVisibleException: The point at which the driver is attempting to click on the element was not scrolled into the viewport.

Reply all
Reply to author
Forward
0 new messages