简体   繁体   English

如何在 Java Selenium 中对右键单击菜单进行操作?

[英]How to act on the right-click menu in Java Selenium?

I'm performing a right-click operation, but I can't click anywhere in the popup menu.我正在执行右键单击操作,但无法单击弹出菜单中的任何位置。 What code can I do this with?我可以用什么代码来做到这一点? I am using chromedriver我正在使用 chromedriver

Your best bet is to use keyboard navigation through the menu.最好的办法是通过菜单使用键盘导航。 Use the down arrow key to go down as many times as needed and then the return key to choose the item you want to activate.使用向下箭头键根据需要多次向下移动,然后使用返回键选择要激活的项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM