Я пытался выполнить щелчок на моей html-странице, но он не может найти элемент.
Вот HTML:
<input type="button" id="btnStopSs" value="Stop" onclick="start_stop_Ss('tag_stopSs');">
Код:
IWebElement user = foxdriver.FindElement(By.Name("user_name"));
IWebElement pwd = foxdriver.FindElement(By.Name("user_passwd"));
user.Clear();
pwd.Clear();
user.SendKeys("admin");
pwd.SendKeys("admin");
IWebElement login = foxdriver.FindElement(By.Name("btnLOGIN"));
login.Click();
Thread.Sleep(3000);
IWebElement stopPage = foxdriver.FindElement(By.TagName("p"));
stopPage.Click();
Thread.Sleep(3000);
IWebElement stoptab = foxdriver.FindElement(By.Id("submenuOnLeftArea0_1"));
stoptab.Click();
Thread.Sleep(3000);
IWebElement stopbtn = foxdriver.FindElement(By.Id("'btnStopSs")); //=>> Error OpenQA.Selenium.NoSuchElementException: 'Unable to locate element: #btnStopss'
stopbtn.Click();
Thread.Sleep(10000);
IWebElement startbtn = foxdriver.FindElement(By.Id("btnStartSs"));
stoptab.Click();