使用 selemium 自动填充文本框命名地址 forms.office C#

Using selemium autofill textbox Name a address forms.office C#

我每天有link自我声明: https://forms.office.com/Pages/ResponsePage.aspx?id=IWuHvDTxEkyiZY7Sa38PO_KiPmlYCpVOuIi4NlZfBs1UOVlCNlNFUTkyR0IwQVZaVDc2Uk9QUlVBUCQlQCN0PWcu

这是link的mircosoft 没有病毒。 我想要编写应用程序自动填写 Full_Name、地址、电子邮件并单击表单中的按钮

元素输入如下:

<input class="office-form-question-textbox office-form-textfield-input form-control office-form-theme-focus-border border-no-radius" placeholder="Enter your answer" spellcheck="true" maxlength="4000" aria-labelledby="QuestionId_rbf8060578cb4410ba72d3e97840ebd95">

我试过项目中的代码:

   var driverService = ChromeDriverService.CreateDefaultService();
            driverService.HideCommandPromptWindow = true;
            ChromeOptions options = new ChromeOptions();
            var driver = new ChromeDriver(driverService, options);
            driver.Navigate().GoToUrl("https://forms.office.com/Pages/ResponsePage.aspx?id=IWuHvDTxEkyiZY7Sa38PO_KiPmlYCpVOuIi4NlZfBs1UOVlCNlNFUTkyR0IwQVZaVDc2Uk9QUlVBUCQlQCN0PWcu");
            IWebElement query = driver.FindElement(By.Id("QuestionId_rbf8060578cb4410ba72d3e97840ebd95"));
            query.SendKeys("David Luis");

下一个变化:

IWebElement query = driver.FindElement(By.Name("Full Name"));

结果显示:OpenQA.Selenium.ElementNotInteractableException: '元素不可交互 (会话信息:chrome=91.0.4472.77)'

问题: 请指导我在这种情况下应该由 class 或 id,由 Name

使用
IWebElement query = driver.FindElement(By.Name("Full Name"));

By.name Selenium 中的定位器用于标识网页的元素。此属性可以作为多个标签的一部分提及,例如