Selenium WebDriver and Firefox drag and drop problems

1,338 views
Skip to first unread message

Alex

unread,
Nov 9, 2012, 4:22:34 AM11/9/12
to seleniu...@googlegroups.com
I am having some problems with performing drag and drop action in firefox.

the code for the action is below:

            Actions slide = new Actions(driver);
           
IAction slidePacket;
           
IWebElement slider = driver.FindElement(By.ClassName("ui-slider-handle"));

            slide
.DragAndDropToOffset(slider, 6, 0);
            slidePacket
= slide.Build();
            slidePacket
.Perform();

the above action are performed several times on a zoom slider (to check that the right zoom is displayed at each slider "checkpoint". up until 125% it works but when it should go to 150% the slider moves but then slides back to 125%. if i increase the offset to the next checkpoint which is 200% the slider will go back to 150%.

On chrome this never happens so the commands should be right.
I found some users saying that firefox native events might be to blame but i tried the above with native events both enabled and disabled with the same results.
Anyone have any idea?

PS:

using selenium 2.25 and firefox 16 (started with 15 guess it updated)
would the firefox version pose a problem? though i don't think so since the bug doesn't even seem to make any sense.

Alex

unread,
Nov 9, 2012, 6:08:55 AM11/9/12
to seleniu...@googlegroups.com
small update. i tried something a bit more complex since i thought the drag and drop action itself might be a bit buggy in firefox i did the following

slide.MoveToElement(slider).ClickAndHold(slider).MoveByOffset(6, 0).Release();
slidePacket = slide.Build();
slidePacket
.Perform();

 however i get the exact same problems. it works until 125% after that the slider starts jumping back. when i drag the slider manually this never happens so i doubt it has to do with the interface itself.

Alex

unread,
Nov 12, 2012, 7:56:05 AM11/12/12
to seleniu...@googlegroups.com
talked a bit to the developer. it seems the slider in question is from jquery UI if it helps identify the problem. but i don't think it matters much since the code works fine on chrome and internet explorer 9, only firefox refuses to work properly.

Alex

unread,
Nov 12, 2012, 8:12:18 AM11/12/12
to seleniu...@googlegroups.com
FOUND THE PROBLEM

in case anyone experiences similar problems update your selenium. apparently there 2.26 fixes the issue on firefox 16 but the main website isn't updated yet.

here is the link for the download.
http://code.google.com/p/selenium/downloads/list

On Friday, November 9, 2012 11:22:34 AM UTC+2, Alex wrote:
Reply all
Reply to author
Forward
0 new messages