Open the Home page using browser controls

This example uses the Describe method to create a regular expression to locate an object.

@Test
publicvoid verify_TipIsPresentedInAUTHomePage() throws Exception {
//Navigate to the home page of the browser using the browser's controls.
com.hp.lft.sdk.stdwin.EditField addressField = Desktop.describe(Window.class, new WindowDescription.Builder()
.ownedWindow(false).childWindow(false).windowClassRegExp("Afx:").windowTitleRegExp("JSCall").build()).describe(Window.class, new WindowDescription.Builder()
.ownedWindow(false).childWindow(true).windowClassRegExp("Afx:").windowTitleRegExp("http://localhost/t112.html").build()).describe(com.hp.lft.sdk.stdwin.EditField.class, new com.hp.lft.sdk.stdwin.EditFieldDescription.Builder()
.attachedText("URL:").nativeClass("Edit").build());
addressField.setText("http://newtours.demoaut.com/");
addressField.click();
addressField.sendKeys(Keys.RETURN);
//Describe the tip image. Since the tip index is generated we will use a regular expression to find it.
Image tip = Desktop.describe(Window.class, new WindowDescription.Builder()
.ownedWindow(false).childWindow(false).windowClassRegExp("Afx:").windowTitleRegExp("JSCall").build()).describe(Window.class, new WindowDescription.Builder()
.ownedWindow(false).childWindow(true).windowClassRegExp("Afx:").windowTitleRegExp("http://newtours.demoaut.com/").build()).describe(Page.class, new PageDescription()).describe(Image.class, new ImageDescription.Builder()
.alt(new RegExpProperty("Tip.*")).type(com.hp.lft.sdk.web.ImageType.NORMAL).tagName("IMG").build());
//Verifies that the tip is found.
Verify.isTrue(tip.exists(), "Verify_TipIsPresentedInAUTHomePage", "Verify that the tip field is found.");
}