Created
August 9, 2022 22:50
-
-
Save bharathmuddada/d84e8147a0ccada63992f737c5ba00ae to your computer and use it in GitHub Desktop.
C# Selenium Implicit Wait Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SeleniumImplicitWait { | |
public static void Main(string[] args) | |
{ | |
new DriverManager().SetUpDriver(new ChromeConfig()); | |
var driver = new ChromeDriver(); | |
driver.Manage().Window.Maximize(); | |
driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); | |
Console.WriteLine("1 -- "+DateTime.Now); | |
driver.Navigate().GoToUrl("https://the-internet.herokuapp.com/dynamic_controls"); | |
driver.FindElement(By.XPath("//button[contains(text(),'Remove')]")).Click(); | |
driver.FindElement(By.XPath("//button[contains(text(),'Add')]")).Click(); | |
driver.FindElement(By.XPath("//button[contains(text(),'Enable')]")).Click(); | |
driver.FindElement(By.XPath("//button[contains(text(),'Disable')]")).Click(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment