I am a new user of Selenium using C# and I want to automate the login process on a third-party website. When I manually navigate to the page in Chrome and inspect the elements, I can see the text boxes for username and password.
<input type="text" id="username" name="username" >
<input type="password" id="password" name="password" >
However, when I view the page source, I do not see these input fields. I suspect that there is JavaScript code generating this login form dynamically.
In Selenium, when I try to locate the elements using their names, I receive a "No Such Element" error as expected:
var x = Driver.FindElement(By.Name("username"));
Is it possible for Selenium to interact with elements that are generated dynamically like in my case? Can I instruct Selenium to wait for the dynamic content to load or somehow access the dynamically created HTML?