示例#1
0
 /// <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");
 }
示例#2
0
 /// <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));
 }
示例#3
0
 /// <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));
 }
示例#4
0
 /// <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));
 }
示例#5
0
 /// <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))));
 }
示例#6
0
 /// <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))));
 }
示例#7
0
 /// <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));
 }