Press and hold <shift> key currently not working in FireFox 13 Selenium 2

578 views
Skip to first unread message

Newbee

unread,
Jun 21, 2012, 2:55:16 PM6/21/12
to seleniu...@googlegroups.com
This is what i am trying to achieve 

1. Click on the first element in a list.
2. Press the <shift> keys and hold it down. 
3. Using the right arrow key/mouse click, select the elements next to the first element. 

I have tried these two approaches with the following problems: 

driver.keyboard.PressKey(Keys.Shift);.
driver.keyboard.PressKey(Keys.ArrowRight):
driver.keyboard.ReleaseKey(Keys.Shift);

Problem: This works great in IE and Chrome, but in Firefox it just clicks on the first element and then moves the selection with the arrow key instead of keeping the multi-select. Is this a known issue? 

The other approach is: 

Actions a = new Actions(driver);
a.KeyDown(Keys.Shift).MoveToElement(WebDriverSetup.driver.FindElementByXPath(ThumbnailViewerUI.second_thumbnail),0,0).Click().Perform();

In this the selection moves with the click, instead being multiselect it just selects the second element. 

Am i missing something? please let me know how I can go about doing this. 


Newbee

unread,
Jun 21, 2012, 3:00:22 PM6/21/12
to seleniu...@googlegroups.com
Update, the first approach now seems to not work for IE... not sure what changed. 

Newbee

unread,
Jun 25, 2012, 3:00:37 PM6/25/12
to seleniu...@googlegroups.com
Any news on when this might work? for FF and IE? i was told this might be a native events issue.. I need help on this please// 

Newbee

unread,
Jun 25, 2012, 7:55:35 PM6/25/12
to seleniu...@googlegroups.com
So for any one else stuck with this situation ... this is what i am doing.. it works for Chrome and FF (13)... not yet for IE(9).... rem this is a grid setup. 


                Actions act_multiselect = new Actions(WebDriverSetup.driver);
                act_multiselect.SendKeys(Keys.LeftShift + Keys.ArrowRight + Keys.ArrowRight + Keys.ArrowRight + Keys.ArrowRight);
                IAction multiselect = act_multiselect.Build();
                multiselect.Perform();
                log.Info(": ShiftMultiSelect() 5 thumbnails selected.");
Reply all
Reply to author
Forward
0 new messages