I'm working on a C# Selenium-WebDriver. After send key, I want to wait few seconds. I do the following code to wait for 2 seconds.
public static void press(params string[] keys)
{
foreach (string key in keys)
{
WebDriver.SwitchTo().ActiveElement().SendKeys(key);
Thread.Sleep(TimeSpan.FromSeconds(2));
}
}
And I call like these:
press(Keys.Tab, Keys.Tab, Keys.Tab);
It works fine. Which one is a better way?