try {
executeJavascript("window.__oldConfirm = window.confirm; window.confirm = function() { return true; };");
final By buttonLocator =
By.xpath("//*[@id='usersandgroupstable-display']//td[@class='username']/a[contains(@href, '"
+ entityName + "')]/../../td[" + right.getColumnIndex() + "]/img");
final WebElement button = getDriver().findElement(buttonLocator);
State currentState = State.getButtonState(button).getNextState();
button.click();
// Note: Selenium 2.0a4 returns a relative URL when calling getAttribute("src") but since we moved to
// Selenium 2.0a7 it returns a *full* URL even though the DOM has a relative URL as in:
// <img src="/xwiki/resources/js/xwiki/usersandgroups/img/allow.png">
waitUntilElementEndsWithAttributeValue(buttonLocator, "src", currentState.imageURL);
} finally {