Multiple table row selection

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple table row selection

priyanka kadam
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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 | Threaded
Open this post in threaded view
|

Re: Multiple table row selection

Xiang Dong
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: [hidden email] <[hidden email]> on behalf of priyanka kadam <[hidden email]>
Sent: Tuesday, June 26, 2018 5:29 PM
To: Selenium Users
Subject: [selenium-users] Multiple table row selection
 
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/SN1PR12MB0349F9FD74295816270ACE4090410%40SN1PR12MB0349.namprd12.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.