Selenium click right on mouse or press option key form keyboard

妖精的绣舞 提交于 2019-12-03 21:54:17

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!