Issue 6468 in selenium: moveToElement() method of Actions class is not working in selenium 2.37

466 views
Skip to first unread message

sele...@googlecode.com

unread,
Oct 24, 2013, 11:15:24 AM10/24/13
to selenium-develope...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium Status-Untriaged

New issue 6468 by perineed...@gmail.com: moveToElement() method of Actions
class is not working in selenium 2.37
http://code.google.com/p/selenium/issues/detail?id=6468

What steps will reproduce the problem?
My webpage has a dropdown ul contains 10 li elements. first 4 li elements
only visible. remaing 6 li elements can be visible by scrolling only.
selenium can't click invisible elements. To make li element visible, I used
to scroll using method moveToElement() of Actions class. So that we can
click element.

WebElement element= ....; //this is the li element which is invisible in
dropdown ul
Actions builder = new Actions(firefoxDriver);
builder.moveToElement(element).build().perform();
element.click();

this code is working fine selenium 2.32 with Firefox 22.
But After upgrading selenium to version 2.37 with Firefox 24.0, It is not
working.


What is the expected output? What do you see instead?
after using moveToElement(element), element should be visible.
But still element is not visible. so element can't be clickable.


Selenium version: 2.37
OS: Ubuntu 12.10
Browser: Firefox
Browser version: 24.0



--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

sele...@googlecode.com

unread,
Oct 24, 2013, 12:03:37 PM10/24/13
to selenium-develope...@googlegroups.com
Updates:
Status: Accepted
Owner: jmle...@gmail.com
Labels: -Status-Untriaged Component-WebDriver Browser-Firefox

Comment #1 on issue 6468 by jmle...@gmail.com: moveToElement() method of
Actions class is not working in selenium 2.37
http://code.google.com/p/selenium/issues/detail?id=6468

Ha! I'm currently investigating the same issue. For me it's Selenium 2.32
and FF 17 to 2.37 and FF 24.

sele...@googlecode.com

unread,
Oct 24, 2013, 3:23:35 PM10/24/13
to selenium-develope...@googlegroups.com

Comment #2 on issue 6468 by barancev: moveToElement() method of Actions
class is not working in selenium 2.37
http://code.google.com/p/selenium/issues/detail?id=6468

And, by the way, provide an executable scenario and a sample page to
reproduce the issue.

sele...@googlecode.com

unread,
Nov 4, 2013, 10:30:47 PM11/4/13
to selenium-develope...@googlegroups.com

Comment #3 on issue 6468 by ily...@gmail.com: moveToElement() method of
Actions class is not working in selenium 2.37
http://code.google.com/p/selenium/issues/detail?id=6468

I've reported a similar issue for ChromeDriver at
https://code.google.com/p/chromedriver/issues/detail?id=605. It works for
me on WebDriver 2.37 & FF 24 though.

sele...@googlecode.com

unread,
Nov 8, 2013, 6:06:38 AM11/8/13
to selenium-develope...@googlegroups.com

Comment #4 on issue 6468 by meri...@gmail.com: moveToElement() method of
Actions class is not working in selenium 2.37
http://code.google.com/p/selenium/issues/detail?id=6468

I'm seeing either the same or very similar issue with 2.37 and Firefox 24 &
25

For me the following testcase scrolls in 24 and does not scroll in 25:
import java.io.File;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxBinary;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.interactions.Actions;

public class Example {
@Test
public void ExampleTest() {
FirefoxProfile p = new FirefoxProfile();
FirefoxDriver driver = new FirefoxDriver(new FirefoxBinary(new
File("C:\\FF-Selenium_\\firefox.exe")), p);
driver.get("http://code.google.com/p/selenium/");
WebElement link = driver.findElement(By.linkText("Terms"));

Actions builder = new Actions(driver);
builder.moveToElement(link).build().perform();
}
}

Obviously for the scrolling to happen the window/screen must be small
enough that the Terms link appears below the fold. I also saw it fail with
2.36 so it seems to be tied to Firefox version change. 2.37 with Firefox 24
scrolls this testcase for me.

sele...@googlecode.com

unread,
Nov 22, 2013, 8:31:38 AM11/22/13
to selenium-develope...@googlegroups.com

Comment #5 on issue 6468 by nidhish....@gmail.com: moveToElement() method
of Actions class is not working in selenium 2.37
http://code.google.com/p/selenium/issues/detail?id=6468

Same issue faced by me too. I used webDriver 2.37 and FF24. Eagerly waiting
for the fix :)

sele...@googlecode.com

unread,
Apr 3, 2014, 4:01:53 PM4/3/14
to selenium-develope...@googlegroups.com

Comment #6 on issue 6468 by rupam08: moveToElement() method of Actions
class is not working in selenium 2.37
http://code.google.com/p/selenium/issues/detail?id=6468

Hi,
I'm facing exactly similar issue with Dropdown options , the ones
which are not in the view.

I have tried alternatives but didn't help :( -

1. IMouse mouse = ((IHasInputDevices)WebDriver).Mouse;
mouse.MouseMove(item.Coordinates);

2. ILocatable item = (ILocatable)option.ControlWebElement;
System.Drawing.Point p = item.LocationOnScreenOnceScrolledIntoView;



Environment -
Os : Win 7 , 64 bit
Selenium 2.37 C# bindings
Firefox 23,26
IE - 10

sele...@googlecode.com

unread,
Apr 14, 2014, 6:27:31 AM4/14/14
to selenium-develope...@googlegroups.com

Comment #7 on issue 6468 by perineed...@gmail.com: moveToElement() method
of Actions class is not working in selenium 2.37
http://code.google.com/p/selenium/issues/detail?id=6468

@rupam08
By using JavaScriptExecutor, if you run jQuery mouseover() on a
dropdownOption which is not in view Then the option may come into the view.
Example: selenium.executeScript("jQuery(\".optionSelector\").mouseover();");
It worked for me as a workaround.

sele...@googlecode.com

unread,
Apr 25, 2014, 1:41:10 PM4/25/14
to selenium-develope...@googlegroups.com

Comment #8 on issue 6468 by fevll...@gmail.com: moveToElement() method of
Actions class is not working in selenium 2.37
http://code.google.com/p/selenium/issues/detail?id=6468

I used contextrightclick to make it visible, avoided moveto for now, worked

sele...@googlecode.com

unread,
Apr 25, 2014, 6:19:20 PM4/25/14
to selenium-develope...@googlegroups.com

Comment #9 on issue 6468 by rupam08: moveToElement() method of Actions
class is not working in selenium 2.37
http://code.google.com/p/selenium/issues/detail?id=6468

I thought of the javascript option, however I'm running tests in parallel
on multiple instances of different browsers, hence if I give control
outside webdriver I think might face browser focus issue.

Please let me know if for anyone running javascript on parallel browser
instances had any -ve effects or not.

sele...@googlecode.com

unread,
Jan 21, 2015, 6:28:09 AM1/21/15
to selenium-develope...@googlegroups.com

Comment #11 on issue 6468 by samson....@gmail.com: moveToElement() method
of Actions class is not working in selenium 2.37
https://code.google.com/p/selenium/issues/detail?id=6468

I got similar challenge with my project. But as I was fiddling with
different methods I found this solution below:

I simply added a .click() method as:
WebElement element= ....; //this is the li element which is invisible in
dropdown ul
Actions builder = new Actions(firefoxDriver);
builder.moveToElement(element).click().build().perform();

Hope this helps

Samson Ojo

sele...@googlecode.com

unread,
Feb 25, 2015, 4:52:05 AM2/25/15
to selenium-develope...@googlegroups.com

Comment #12 on issue 6468 by maheshk...@gmail.com: moveToElement() method
of Actions class is not working in selenium 2.37
https://code.google.com/p/selenium/issues/detail?id=6468

Hi Friends..


moveToElement is not working in my FF 35.0.1 and selenium 2.44.0 below is
the code Colud any one please help on this

package com.selenium.training;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Action;
import org.openqa.selenium.interactions.Actions;
import org.testng.annotations.Test;

public class action1 {

public static WebDriver driver;
public action1()
{
driver=new FirefoxDriver();
}

@Test
public void facebook()
{
driver.navigate().to("https://facebook.com");
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(5000,TimeUnit.SECONDS);
WebElement username=driver.findElement(By.id("email"));
System.out.println(username.getSize());
//username.sendKeys("Mahesh");
Actions builder=new Actions(driver);
builder.moveToElement(username,150,22);
builder.sendKeys("Mahesh");
builder.perform();
Action
seriesofactions=builder.moveToElement(username).click().keyDown(username,Keys.SHIFT).sendKeys(username,"hell").keyUp(username,Keys.SHIFT).doubleClick(username).contextClick(username).build();
seriesofactions.perform();
Reply all
Reply to author
Forward
0 new messages