HttpWatch Automation Reference - Version 15.x
HttpWatch Namespace / Entries Class / Find Method

Pass null to search from the first entry or a reference to an Entry (request) object after which the search should start.

This parameter must be null when searching by ID.

Pass a numeric value as a string, e.g. "42", to search for an Entry (request) object by ID. You can view the ID in HttpWatch by adding an ID column or opening the Overview tab for a specific request. When searching by ID a null value must be passed to the searchAfterEntry parameter.

Passing a URL e.g. "https://www.httpwatch.com" in this parameter will search for an Entry (request) object with a matching URL.


In This Topic
    Find Method
    In This Topic
    Locates requests by ID or URL
    Syntax
    'Declaration
     
    Public Function Find( _
       ByVal searchAfterEntry As Entry, _
       ByVal searchFor As String _
    ) As Entry
    public Entry Find( 
       Entry searchAfterEntry,
       string searchFor
    )

    Parameters

    searchAfterEntry

    Pass null to search from the first entry or a reference to an Entry (request) object after which the search should start.

    This parameter must be null when searching by ID.

    searchFor

    Pass a numeric value as a string, e.g. "42", to search for an Entry (request) object by ID. You can view the ID in HttpWatch by adding an ID column or opening the Overview tab for a specific request. When searching by ID a null value must be passed to the searchAfterEntry parameter.

    Passing a URL e.g. "https://www.httpwatch.com" in this parameter will search for an Entry (request) object with a matching URL.

    Return Value

    Returns a reference to the Entry object that was located or null if no matching entry was found.
    Example
    Entries.Find
    Copy Code
    // Find the request with ID 42
    var entry = log.Entries.Find(null, "42");
    if ( entry == null )
    {
        Console.WriteLine("No request was found with ID = 42");
    }
    // Find the first occurrence of a URL
    var logoPng1 = log.Entries.Find(null, "https://www.httpwatch.com/logo1.png");
    
    // If request was found look for second occurrence
    if ( logoPng1 != null )
    {
        var logoPng2 = log.Entries.Find(logoPng1 , "https://www.httpwatch.com/logo1.png");
    }
            
    
    Requirements
    HttpWatch 13.0 or later
    See Also