更新时间:2023-10-26 21:01:34
要从上下文菜单中选择项目,您只需使用按键向下事件移动鼠标位置,如下所示: -
To select the item from the contextual menu, you have to just move your mouse positions with the use of Key down event like this:-
Actions action= new Actions(driver);
action.contextClick(productLink).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.RETURN).build().perform();
希望这对你有用。
祝你有美好的一天:)
hope this will works for you. Have a great day :)