Using selenium how can I click on the right click of mouse or press on the option key from keyboard(This key is usually available between right ALT and CTRL开发者_JAVA百科 key)
If you are trying to open the context menu, there is a selenium.contextMenu(locator)
. This is the menu that opens up when you right click or press that option key.
This example shows you how to open a page element in a new tab from context menu. The page used for example is seleniumhq.org. This code will right click on the logo link and open the page in a new tab
selenium.contextMenu(link=Selenium);
//In the below line of code "t" is the shortcut to open the page in a new tab
selenium.keyPress("link=Selenium","t");
Hope this helps.
精彩评论