public static bool TitleContains(this IWebDriver driver, string text) { driver.CheckNotNull(nameof(driver)); text.CheckNotNullOrEmpty(nameof(text)); return(driver?.Title.Contains(text) ?? false); }
/// <summary> /// Performs actions. /// </summary> /// <param name="driver">WebDriver</param> /// <param name="actions">The actions.</param> /// <returns></returns> public static IWebDriver Perform(this IWebDriver driver, Func <Actions, Actions> actions) { driver.CheckNotNull(nameof(driver)); actions.CheckNotNull(nameof(actions)); var act = new Actions(driver); act = actions(act); act.Perform(); return(driver); }
public static WebDriverExtendedSearchContext Try(this IWebDriver driver, TimeSpan timeout, TimeSpan retryInterval) { driver.CheckNotNull(nameof(driver)); return(new WebDriverExtendedSearchContext(driver, timeout, retryInterval)); }
public static WebDriverExtendedSearchContext Try(this IWebDriver driver) { driver.CheckNotNull(nameof(driver)); return(new WebDriverExtendedSearchContext(driver)); }
/// <summary> /// Sets the position of the browser window relative to the upper-left corner of the screen. /// </summary> /// <returns></returns> public static IWebDriver SetPosition(this IWebDriver driver, int x, int y) { driver.CheckNotNull(nameof(driver)); driver.Manage().Window.Position = new Point(x, y); return(driver); }
/// <summary> /// Sets the size of the outer browser window, including title bars and window borders. /// </summary> /// <param name="driver">WebDriver</param> /// <param name="width">The width.</param> /// <param name="height">The height.</param> /// <returns></returns> public static IWebDriver SetSize(this IWebDriver driver, int width, int height) { driver.CheckNotNull(nameof(driver)); driver.Manage().Window.Size = new Size(width, height); return(driver); }
/// <summary> /// Maximizes the browser. /// </summary> /// <param name="driver">The driver.</param> /// <returns></returns> public static IWebDriver Maximize(this IWebDriver driver) { driver.CheckNotNull(nameof(driver)); driver.Manage().Window.Maximize(); return(driver); }