I am trying to select a row in a table by clicking it then moving to a second, holding shift or control and clicking that row to highlight both rows. I am having a problem with this using selenium webdriver and java. I can't see why this code doesn't work? It will select the first row then highlights the second also but when it clicks the second row the first is deselected? This is the code I am using:
new Actions(driver)
.moveToElement(selectConsentRow)
.click()
.moveToElement(secondRow)
.keyDown(Keys.SHIFT)
.click()
.perform();
CTRLbut your code saysSHIFT, typo? Just a wonder. Looking at the code through, it appears to be 'correct'. I do notice you're missing a.build()before the.perform(). Have you tried with that?