public virtual object Decorate(FieldInfo field) { if (!(typeof(IWebElement).IsAssignableFrom(field.FieldType) || IsDecoratableList(field))) { return(null); } IElementLocator locator = factory.CreateLocator(field); if (locator == null) { return(null); } if (typeof(IWebElement).IsAssignableFrom(field.FieldType)) { return(ProxyForLocator(locator)); } else if (typeof(IList).IsAssignableFrom(field.FieldType)) { return(ProxyForListLocator(locator)); } else { return(null); } }
public static T InitElements <T>(IWebDriver driver, IElementLocatorFactory locatorFactory) { if (locatorFactory == null) { throw new ArgumentNullException("locatorFactory", "locatorFactory cannot be null"); } return(InitElements <T>(locatorFactory.CreateLocator(driver))); }
public static void InitElements(ISearchContext driver, object page, IElementLocatorFactory locatorFactory) { if (locatorFactory == null) { throw new ArgumentNullException("locatorFactory", "locatorFactory cannot be null"); } InitElements(page, locatorFactory.CreateLocator(driver)); }