Run TestCusorPosition test in Opera 8. It will fail.
Now try replacing the refreshAndWait call with unselectText (described below). Instead of correctly reporting that there is no cursor, it incorrectly reports that the cursor exists at its previous location, which is definitely incorrect.
No obvious way to fix this; just adding a warning in the docs.
Here's a command that will unselectText:
Selenium.prototype.doUnselectText = function() {
/**
*/
var win = this.browserbot.getCurrentWindow();
var doc = this.page().currentDocument;
if (doc.selection && doc.selection.empty) { doc.selection.empty(); doc.selection.clear(); return; } else if (win.getSelection && win.getSelection().removeAllRanges) { win.getSelection().removeAllRanges(); return; }
else if (doc.getSelection && doc.getSelection().removeAllRanges) { doc.getSelection().removeAllRanges(); return; }
throw new Error("Couldn't unselect text on this browser!");
}
Note that to add this into selenium and add a test for it, we'd have to add a function that can select text, which will be tricky in Selenese, because you'll have to supply three arguments: locator, start, and end.