Ejemplo n.º 1
0
        private List <string> GetDiscussionUrls(IE ie, string siteUrl)
        {
            List <string> discussions = new List <string>();

            ie.GoTo(siteUrl);
            ie.WaitForComplete();

            bool done = false;

            ie.Link(Find.ById("discussionTab")).Click();
            while (!done)
            {
                ie.WaitForComplete();
                foreach (var div in ie.Divs)
                {
                    if (div.ClassName == "post_content")
                    {
                        discussions.Add(div.Link(Find.First()).Url);
                    }
                }

                var pag  = ie.List(Find.ById("discussion_pagination"));
                var link = pag.Link(Find.ByText("Next"));
                if (link.Exists)
                {
                    link.Click();
                }
                else
                {
                    done = true;
                }
            }

            return(discussions);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Finds a table row within the table itself (excluding content from any tables that
 /// might be nested within it).
 /// </summary>
 /// <param name="elementId">The element id regular expression</param>
 /// <returns>The table row</returns>
 public virtual TableRow OwnTableRow(Regex elementId)
 {
     return(OwnTableRow(Find.ById(elementId)));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Finds a table row within the table itself (excluding content from any tables that
 /// might be nested within it).
 /// </summary>
 /// <param name="elementId">The element id</param>
 /// <returns>The table row</returns>
 public virtual TableRow OwnTableRow(string elementId)
 {
     return(OwnTableRow(Find.ById(elementId)));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Finds a table body within the table itself (excluding content from any tables that
 /// might be nested within it).
 /// </summary>
 /// <param name="elementId">The element id regular expression</param>
 /// <returns>The table body</returns>
 public virtual TableBody OwnTableBody(Regex elementId)
 {
     return(OwnTableBody(Find.ById(elementId)));
 }
 /// <inheritdoc />
 public Constraint ByDefault(Regex value)
 {
     return(Find.ById(value));
 }
 /// <inheritdoc />
 public Constraint ByDefault(string value)
 {
     return(Find.ById(value));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Finds a table cell within the table row itself (excluding content from any tables that
 /// might be nested within it).
 /// </summary>
 /// <param name="elementId">The element id regular expression</param>
 /// <returns>The table cell</returns>
 public virtual TableCell OwnTableCell(Regex elementId)
 {
     return(OwnTableCell(Find.ById(elementId)));
 }
Ejemplo n.º 8
0
 public virtual TableCell TableCell(Regex elementId, int index)
 {
     return(TableCell(Find.ById(elementId) & Find.ByIndex(index)));
 }
Ejemplo n.º 9
0
 public virtual TableCell TableCell(string elementId, int index)
 {
     return(TableCell(Find.ById(elementId) & Find.ByIndex(index) & Find.Any));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Gets the specified frame by its id.
 /// </summary>
 /// <param name="id">The regular expression to match with the id of the frame.</param>
 /// <exception cref="FrameNotFoundException">Thrown if the given <paramref name="id" /> isn't found.</exception>
 public virtual Frame Frame(Regex id)
 {
     return(Frame(Find.ById(id)));
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Gets the specified frame by its id.
 /// </summary>
 /// <param name="id">The id of the frame.</param>
 /// <exception cref="FrameNotFoundException">Thrown if the given <paramref name="id" /> isn't found.</exception>
 public virtual Frame Frame(string id)
 {
     return(Frame(Find.ById(id)));
 }
Ejemplo n.º 12
0
 public static TableCell TableCell(DomContainer domContainer, Regex elementId, int index, IElementCollection elements)
 {
     return(new TableCell(domContainer, domContainer.NativeBrowser.CreateElementFinder(Core.TableCell.ElementTags, Find.ByIndex(index).And(Find.ById(elementId)), elements)));
 }
 public TableCell TableCell(string elementId, int index)
 {
     return(TableCell(Find.ById(elementId) & Find.ByIndex(index)));
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Finds a list item within the list itself (excluding content from any lists that
 /// might be nested within it).
 /// </summary>
 /// <param name="elementId">The element id regular expression</param>
 /// <returns>The list item</returns>
 public virtual ListItem OwnListItem(Regex elementId)
 {
     return(OwnListItem(Find.ById(elementId)));
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Finds a list item within the list itself (excluding content from any lists that
 /// might be nested within it).
 /// </summary>
 /// <param name="elementId">The element id</param>
 /// <returns>The list item</returns>
 public virtual ListItem OwnListItem(string elementId)
 {
     return(OwnListItem(Find.ById(elementId)));
 }