Multiple table row selection

22 views
Skip to first unread message

priyanka kadam

unread,
Jun 26, 2018, 8:45:54 AM6/26/18
to Selenium Users
Hi 

I want to select multiple table row.
I have used below code for same but it will select one row.
Actions actions = new Actions(driver);
List<WebElement> items = page.getAllActiveUnmatchItemRows();
actions .click(items.get(0)).keyDown(Keys.CONTROL).click(items.get(1)).keyUp(Keys.CONTROL).build().perform();

Please help me out.

Xiang Dong

unread,
Jul 4, 2018, 3:57:29 AM7/4/18
to priyanka kadam, seleniu...@googlegroups.com
actions .click(items.get(0)).keyDown(Keys.CONTROL).click(items.get(1)).keyUp(Keys.CONTROL).build().perform();
how about you change the action sequence

actions.keyDown(Keys.Control).moveToElement(ele1).cleck(ele1)..moveToElement(ele2).cleck(ele2).keyUp(keys.Control).build().perform();

--david

From: seleniu...@googlegroups.com <seleniu...@googlegroups.com> on behalf of priyanka kadam <priyak...@gmail.com>
Sent: Tuesday, June 26, 2018 5:29 PM
To: Selenium Users
Subject: [selenium-users] Multiple table row selection
 
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/a7e85fbf-3e9f-46c4-9839-68e0f6e15a6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages