How to add a conditional wait on an element in pytest?

How to add a conditional wait on an element in pytest?

Hi Helen!

To add a conditional wait on an element in pytest, you can use the below command in your test script.

driver.Url = "https://www.google.com/ncr";
driver.Find_Element(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")));