Index: src/main/resources/core/scripts/selenium-browserbot.js =================================================================== --- src/main/resources/core/scripts/selenium-browserbot.js (revision 1754) +++ src/main/resources/core/scripts/selenium-browserbot.js (working copy) @@ -1333,6 +1333,10 @@ this._fireEventOnElement("dblclick", element, clientX, clientY); }; +BrowserBot.prototype.contextmenuElement = function(element, clientX, clientY) { + this._fireEventOnElement("contextmenu", element, clientX, clientY); +}; + BrowserBot.prototype._modifyElementTarget = function(element) { if (element.target) { if (element.target == "_blank" || /^selenium_blank/.test(element.target) ) { Index: src/main/resources/core/scripts/selenium-api.js =================================================================== --- src/main/resources/core/scripts/selenium-api.js (revision 1754) +++ src/main/resources/core/scripts/selenium-api.js (working copy) @@ -223,6 +223,17 @@ this.browserbot.doubleClickElement(element); }; +Selenium.prototype.doContextMenu = function(locator) { +/** +* Calls contextmenu for an element. +* +* @param locator an element locator +* +*/ + var element = this.browserbot.findElement(locator); + this.browserbot.contextmenuElement(element); +}; + Selenium.prototype.doClickAt = function(locator, coordString) { /** * Clicks on a link, button, checkbox or radio button. If the click action @@ -255,6 +266,20 @@ this.browserbot.doubleClickElement(element, clientXY[0], clientXY[1]); }; +Selenium.prototype.doContextMenuAt = function(locator, coordString) { +/** +* Calls contextmenu for an element. +* +* @param locator an element locator +* @param coordString specifies the x,y position (i.e. - 10,20) of the mouse +* event relative to the element returned by the locator. +* +*/ + var element = this.browserbot.findElement(locator); + var clientXY = getClientXY(element, coordString) + this.browserbot.contextmenuElement(element, clientXY[0], clientXY[1]); +}; + Selenium.prototype.doFireEvent = function(locator, eventName) { /** * Explicitly simulate an event, to trigger the corresponding "onevent"