/// <summary> /// Returns an OpenQA.Selenium.By instance that is equivalent to /// id. Only supports PageElementID instances whose Context value is /// Css, ClassName, Id, or XPath. /// </summary> /// <param name="id"></param> /// <returns>OpenQA.Selenium.By</returns> private OpenQA.Selenium.By transformPageElementID(PageElementID id) { if (id.Context == PageElementSearchContext.Css) { return(OpenQA.Selenium.By.CssSelector(id.Value)); } if (id.Context == PageElementSearchContext.ClassName) { return(OpenQA.Selenium.By.ClassName(id.Value)); } if (id.Context == PageElementSearchContext.Id) { return(OpenQA.Selenium.By.Id(id.Value)); } if (id.Context == PageElementSearchContext.XPath) { return(OpenQA.Selenium.By.XPath(id.Value)); } throw new Exception("PageElementID not valid"); }
/// <summary> /// Returns an IInputable instance identified by id /// </summary> /// <param name="id">PageElementID</param> /// <returns></returns> public IInputable CreateInputable(PageElementID id) { return(Implementor.CreateInputable(id)); }
/// <summary> /// Returns an IReadable instance identified by id /// </summary> /// <param name="id">PageElementID</param> /// <returns></returns> public IReadable CreateReadable(PageElementID id) { return(Implementor.CreateReadable(id)); }
/// <summary> /// Returns an IClickable instance identified by id /// </summary> /// <param name="id">PageElementID</param> /// <returns></returns> public IClickable CreateClickable(PageElementID id) { return(Implementor.CreateClickable(id)); }
/// <summary> /// Creates an IInputable instance that corresponds to id. /// </summary> /// <param name="id">PageElementID</param> /// <returns>IInputable</returns> public IInputable CreateInputable(PageElementID id) { return(new WebDriverInputable(Driver.FindElement(transformPageElementID(id)))); }
/// <summary> /// Creates an IReadable instance that corresponds to id. /// </summary> /// <param name="id">PageElementID</param> /// <returns>IReadable</returns> public IReadable CreateReadable(PageElementID id) { return(new WebDriverReadable(Driver.FindElement(transformPageElementID(id)))); }
/// <summary> /// Creates an IClickable instance that corresponds to id. /// </summary> /// <param name="id">PageElementID</param> /// <returns>IClickable</returns> public IClickable CreateClickable(PageElementID id) { return(new WebDriverClickable(Driver.FindElement(transformPageElementID(id)), Driver)); }