WebDriver and Firefox: how to select multiple rows in a multi select table?

Hello,

I try to test our Vaadin-based Application using WebDriver and Firefox.
This works reasonably well.

However, selecting multiple rows in a multi selection table does not work for me
whatever I try:

Everytime I Ctrl+Click the second row, the selection on the first selected row vanishes…

Lately I tried to double check our implementation by directing the test to the Vaadin
Sampler as sketched below, but that doesn’t work either… :frowning:


// Note: this is only a sketch - to successfully execute this You need to introduce some waits

WebDriver webDriver = new FirefoxDriver();

webDriver.navigate().to(new URL("http://demo.vaadin.com/sampler#TableMultipleSelection"));

WebElement table = webDriver.findElement(By.className("iso3166"));
WebElement row1 = table.findElement(By.xpath(".//div[@class='v-table-body']
//tr[1]
//td[2]
/div"));
WebElement row2 = table.findElement(By.xpath(".//div[@class='v-table-body']
//tr[2]
//td[2]
/div"));

Keyboard keyboard = ((HasInputDevices) webDriver).getKeyboard();
Mouse mouse = ((HasInputDevices) webDriver).getMouse();

keyboard.pressKey(Keys.CONTROL);
mouse.click(((Locatable) row1).getCoordinates());
keyboard.releaseKey(Keys.CONTROL);

keyboard.pressKey(Keys.CONTROL);
mouse.click(((Locatable) row2).getCoordinates());
keyboard.releaseKey(Keys.CONTROL);

Any help is greatly appreciated.

Hi,

could this issue be related to the following initialization code of Vaadins VScrollTable?


        ...
        if (BrowserInfo.get().isGecko()) {
            scrollBodyPanel.addKeyPressHandler(navKeyPressHandler);
        } else {
            scrollBodyPanel.addKeyDownHandler(navKeyDownHandler);
        }
        ...