I'm new to Selenium and try to automatically open a website in Full Screen mode.
- The website has a Login which is already working with Selenium.
- After the login only one button has to be pressed.
Hereby an WebdriverTimoutException
is thrown in the second last line.
- The
InnerException
saysNoSuchElementException
. - But when I open the web console, I can see the button.
IWebDriver driver = new EdgeDriver(System.IO.Directory.GetParent(System.IO.Directory.GetParent(Environment.CurrentDirectory).ToString()).ToString() + "\\webdriver");
driver.Navigate().GoToUrl(@"http://examplehomepage.com");
driver.FindElement(By.Id("username")).SendKeys("abc");
driver.FindElement(By.Id("password")).SendKeys("password123");
driver.FindElement(By.TagName("button")).Click();
driver.Manage().Window.FullScreen();
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(30));
IWebElement element = wait.Until(ExpectedConditions.ElementToBeClickable(By.TagName("button")));
element.Click();
I tried it with:
- Edge (85.0.564.44)
- Chrome (85.0.4183.83)
- Firefox(80.0.1).