我正在尝试使用 nunit + Selenium + c# 创建一个自动化框架
我们的 webadmin 基于 Devexpress 框架,因此我无法通过它的“ID”点击按钮,或者至少我不知道如何点击。对此的替代是简单地按下“Enter”按钮。 我已经试过了
driver.FindElement(By.XPath("String")).SendKeys(Keys.Enter);
最佳答案
using OpenQA.Selenium.Interactions;
Actions builder = new Actions(driver);
builder.SendKeys(Keys.Enter);
关于c# - 如何在用 C# 编写的 Selenium WebDriver(Nunit 测试用例)中按 "Enter"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17552477/