How to add a conditional wait on an element with C#- NUnit?

How to add a conditional wait on an element with C#- NUnit?

Hey Rhian,

To add a conditional wait on an element with C#- NUnit, you can refer to the sample code snippet below:

driver = new ChromeDriver();
driver.Url = "https://www.google.com/ncr";
driver.FindElement(By.Name("q")).SendKeys("cheese" + Keys.Enter);

WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
IWebElement firstResult = wait.Until(e => e.FindElement(By.XPath("//a/h3")));

Console.WriteLine(firstResult.Text);