Here is Simple dynamic RFT script which will launch a browser and then opens google home page and enters some thing in the search text box and searches for the same ...
public void testMain(Object[] args)
{
startBrowser("http://google.co.in");
sleep(25);
TestObject[] to = getRootTestObject().find(
atDescendant(".class","Html.INPUT.text",".title","Google Search"));
// print dialog test object properties to console
/*for (int i = 0; i < to.length; i++) {
System.out.println (to[i].getProperties());
}*/
GuiTestObject contactLink = new GuiTestObject(to[0]);
contactLink.click();
BrowserTestObject b = findBrowser();
b.inputChars("How to use RFT find method");
TestObject[] to1 = getRootTestObject().find(
atDescendant(".class","Html.INPUT.submit",".value","Google Search"));
GuiTestObject searchButton = new GuiTestObject(to1[0]);
searchButton.click();
sleep(20);
b.close();
}
private BrowserTestObject findBrowser(){
TestObject[] foundTOs = find(atDescendant(".class", "Html.HtmlBrowser"));
BrowserTestObject browser = (BrowserTestObject) foundTOs[0];
return browser;
}
}