硒C#OpenQA.Selenium.NoSuchElementException

硒C#OpenQA.Selenium.NoSuchElementException,c#,visual-studio,selenium,selenium-webdriver,selenium-chromedriver,C#,Visual Studio,Selenium,Selenium Webdriver,Selenium Chromedriver,试图简单地点击一个文本框,但得到一个OpenQA.Selenium.NoTouchElementException错误。我尝试了使用ID、CSSSelector和xPath的所有可能组合,但没有成功。我还添加了不同的等待时间和不同的隐式等待和显式等待,但是,这并没有解决问题 在等待元素可见时,我得到了OpenQA.Selenium.NoSuchElementException 这是我的密码: //Open URL of Service Now driver.Url = "http

试图简单地点击一个文本框,但得到一个OpenQA.Selenium.NoTouchElementException错误。我尝试了使用ID、CSSSelector和xPath的所有可能组合,但没有成功。我还添加了不同的等待时间和不同的隐式等待和显式等待,但是,这并没有解决问题

在等待元素可见时,我得到了OpenQA.Selenium.NoSuchElementException

这是我的密码:

    //Open URL of Service Now
    driver.Url = "https://-------.service-now.com/"; //censored
    System.Threading.Thread.Sleep(5000);

    driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
    WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
    wait.Until(ExpectedConditions.ElementIsVisible(By.CssSelector("#user_name")));
    wait.Until(ExpectedConditions.ElementToBeClickable(By.CssSelector("#user_name")));
    driver.FindElement(By.CssSelector("#user_name")).Click();
以下是CSS的图像:

请发布完整的HTML源代码以及可能的副本