Selenium WebDriver provides
ActionBuilder to perform complex user interactions with a web page. It allows chaining multiple actions together to perform a complex action.
You can create a complex action and execute the action (perform) it in the following manner. (Ruby)
driver.action.key_down(:shift). click(element). click(second_element). key_up(:shift). drag_and_drop(element, third_element). perform
The action to open the context menu is
By default, it will click on the middle of the element if you provide one. Otherwise, it will click where the mouse pointer is at.
If you want to move the pointer to a specific location of the page before clicking, use method
If you want to select an item from the context menu use arrow keys and enter then perform the action. You can also further pinpoint the cursor position by using custom position from your element reference
page.driver.browser.action.move_to(webdriver_element, 5, 10) .context_click .send_key(:arrow_down) .send_keys(:enter) .perform