/// <summary> /// Finds an element whos attribute contains the provided text. /// </summary> /// <param name="webDriver"></param> /// <param name="elementName"></param> /// <param name="attributeName"></param> /// <param name="containsText"></param> /// <returns></returns> public static IWebElement FindElementByAttributeContains(this IWebDriver webDriver, string elementName, string attributeName, string containsText) { return(webDriver.FindElementWithWait((driver) => driver.FindElement(By.CssSelector(CssSelectorFactory.AttributeValueContainsSelector(elementName, attributeName, containsText))))); }
/// <summary> /// Finds an element whos attribute is prefixed with the provided text. /// </summary> /// <param name="webDriver"></param> /// <param name="elementName"></param> /// <param name="attributeName"></param> /// <param name="prefix"></param> /// <returns></returns> public static IWebElement FindElementByAttributePrefix(this IWebDriver webDriver, string elementName, string attributeName, string prefix) { return(webDriver.FindElementWithWait((drv) => drv.FindElement(By.CssSelector(CssSelectorFactory.AttributeValuePrefixSelector(elementName, attributeName, prefix))))); }