Ejemplo n.º 1
0
 public static Link link(this WatiN_IE watinIe, string name)
 {
     foreach (var link in watinIe.links())
     {
         if (link.id() == name || link.text() == name)
         {
             return(link);
         }
     }
     "in WatiN_IE could not find Link with name:{0}".error(name ?? "[null value]");
     return(null);
 }
Ejemplo n.º 2
0
 public static bool hasLink(this WatiN_IE watinIe, string nameOrId)
 {
     foreach (var link in watinIe.links())
     {
         if (link.id() == nameOrId || link.text() == nameOrId)
         {
             return(true);
         }
     }
     return(false);
     //return watinIe.links().ids().Contains(id);
 }
 /// <summary>
 /// Finds a link in the current page
 ///
 /// The value is normalized (ie. converted to lowercase + trimmed) and the search order is
 ///   1) id
 ///   2) name
 ///   2) innerText
 /// </summary>
 /// <param name="watinIe"></param>
 /// <param name="value"></param>
 /// <param name="logError"></param>
 /// <returns></returns>
 public static Link link(this WatiN_IE watinIe, string value, bool logError = true)
 {
     value = value.lower().trim();
     foreach (var link in watinIe.links())
     {
         if (link.id().lower() == value || link.text().lower() == value)
         {
             return(link);
         }
     }
     if (logError)
     {
         "in WatiN_IE could not find Link with name:{0}".error(value ?? "[null value]");
     }
     return(null);
 }