I am completely new to Selenium, started using it yesterday and I am pretty much done with the first part of my project and I really love the way its going.
Altho I am having one problem, currently I am using Thread.Sleep for pauses until elements get present. There are some animations going on or just slow loading at times, how can I make it wait until the element is present and then interact with it?
For example:
LoginPageElements loginPage = new LoginPageElements();
loginPage.continueLink.Click();
Thread.Sleep(5000); //here it has to wait until the next page loads
ClickDailyBonusPopUp();
Driver.driver.Navigate().GoToUrl(.....);
Thread.Sleep(2000); //here it has to wait until a login form pops up
LoginFormElements loginForm = new LoginFormElements();
loginForm.userPasswordLogin.Click();
Thread.Sleep(2000); //here it has to wait until a different login form pops up