//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");