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 currency.
    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("MyName");

Tips to improve your search results... OpenText™ Functional Testing for Developers .NET SDK Version: 25.2 OpenText™ Functional Testing for Developers SDK 25.2 All View Local Help Center View Online Help Center Version: