I would like Selenium to be capable of handling triple-clicks properly. This would provide the ability to easily select paragraphs of text.
I have a test that verifies the ability to copy and paste a paragraph. With the Selenium Actions class, I am able to double click to select a word. As soon as I immediately call the click method a third time, I expect the whole paragraph to get selected. What happens in reality is that the selected word becomes unselected.
static void click(WebDriver webDriver) {
Actions actions = new Actions(webDriver)
actions.click()
.click() // **at this point, a single word is selected**
.click() // **this third click should select the whole paragraph, but it does not**
.build()
.perform()
}
This needs to get updated in the drivers and potentially in the WebDriver specification.
Added a wpt for this https://github.com/web-platform-tests/wpt/pull/23456
IIRC: We did not spec "double click" and "triple click" in the spec because they are not standardized. If you manually send two clicks within 500ms of each other and that produces a double-click in your OS, then doing the same thing in webdriver must also produce a double-click. However, we cannot say that "a double-click must do such and such" because double-click is not defined.
@thejohnjansen, the double click is working as expected for my OS but not the triple click. Does mean I have to create a bug report instead?
We decided in the WG not to document it because each OS does this slightly differently and there was no way we could document it properly. Each OS "just knows" the right thing to do. The test I added to wpt in the above comment should be enough to get drivers to do the right thing.
Ah I understand. Many thanks for that; much appreciated!
Most helpful comment
We decided in the WG not to document it because each OS does this slightly differently and there was no way we could document it properly. Each OS "just knows" the right thing to do. The test I added to wpt in the above comment should be enough to get drivers to do the right thing.