Share this page

Describe Method (IBrowser)
Describes a child test object.
Overload List

Overload | Description
--- | ---
Describe<TChild>(IDescription) | Describes a child test object.
Describe<TChild>(XPathDescription) | Describes a child test object using the provided XPath.
Describe<TChild>(CSSDescription) | Describes a child test object using the provided CSS selector.

Example

    //Create a description for a link and then click the link.
    browser.Describe<ILink>(new LinkDescription
    {
        TagName = @"A",
        InnerText = @"Business Travel @ About.com"
    }).Click();

    // This example locates an Image in a browser
    IImage tip = browser.Describe<IImage>(new ImageDescription
    {
        Alt = As.RegExp(@"Tip.*"),
        Type = HP.LFT.SDK.Web.ImageType.Normal,
        TagName = @"IMG"
    });

    //gets the list ob cities.
    var departureCombo = browser.Describe<IListBox>(new ListBoxDescription
    {
        TagName = @"SELECT",
        Name = @"fromPort"
    });

    //sorts the list of cities.
    var departureCities = departureCombo.Items;

    var specialOffers = browser.Describe<ITable>(new TableDescription
    {
        TagName = @"TABLE",
        Index = 9
    });

    //goes over the offers and checks their curency.
    foreach (var offer in specialOffers.Rows)
    {
        Verify.IsTrue(offer.Cells[1].Text.StartsWith("$"), "Doc_Web_TableCells_Small", "Verify that currencies are in Dollars.");
    }

    var usernameLabel = browser.Describe<IWebElement>(new WebElementDescription
    {
        TagName = @"TD",
        InnerText = @"User Name:"
    });
    browser.Describe<IEditField>(new EditFieldDescription
    {
        Vri =
            {
                new VisualRelation{
                    TestObject = usernameLabel,
                     HorizontalRelation = HorizontalVisualRelation.LeftAndInline
                }
            }
    }).SetValue("mercury");

Tips to improve your search results... UFT Developer .NET SDK Reference Version 15.0-15.0.2 UFT Developer SDK Reference All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: