public static IWebElement GetElementById(this RemoteWebDriver driver, string id)
{
int triesCount = 0;
do
{
try
{
IWebElement result = driver.FindElementById(id);
if (result != null)
{
return(result);
}
}
catch
{
Thread.Sleep(250);
triesCount++;
}
} while (triesCount < 10);
throw new InvalidOperationException($"Element with id '{id}' couldn't be found.");
}