[英]Select item from the browser context menu
var selectButtonElement = WindowsDriver.FindElementByAccessibilityId(SelectButtonAutomationId);
Actions action = new Actions(WindowsDriver);
action.ContextClick(selectButtonElement).SendKeys(OpenQA.Selenium.Keys.Down).SendKeys(OpenQA.Selenium.Keys.Enter).Build().Perform();
您可以使用contextClick()
構建操作:
Actions actions = new Actions(webDriver);
actions.contextClick().sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.RETURN).perform();
它在Java
中,但您可以在 C# 中輕松實現類似的東西。 它會從上下文菜單中選擇一些東西,你只需要添加更多ARROW_DOWN
的
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.