System.out.println("\n==>Following are the names of Used Objects in the given script i.e. "+scriptName+"\n");
for ( int i = 0; i<usedObjects.size(); i++)
{
System.out.println(usedObjects.get(i));
}
if (allObjectAreUsed == 0 ) {
System.out.println("All objects are used in the given script i.e. "+scriptName+"\n");
}*/

Below mention code is just to find a web Browser and close it.

// Find all the windows on the system
IWindow windows[] = root.getTopWindows();
String className;

for (int i=0;i<windows.length;i++)
{
// Get the class name of each window
className = windows[i].getWindowClassName();
System.out.println(className);
// If the window is an instance of IE, close it
if (className.equals("IEFrame"))
{//if this matches your application you can use the find method to find the object .Find method has been listed in my other code...
System.out.println("***************"+className);
windows[i].close();
}
}
}

/**
* From is the array which you want to convert.Replace it with any array variable like String ,int.... <br>
* To is the array type you want to convert to.Replace it with any array variable like String ,int....<br>
*
*Dec 11, 2015
*@author kadhikari
* @param objectArray
* @return
*/

Keys without print representation, for example, backspace, escape, print-screen, and so on, are tool-given names. To play back one of these keys, put its name in curly braces. The names are case-insensitive; for example , you can enter either {TAB} or {tab} and get the same result. Some keys have more than one name; for example, {BACKSPACE} and {BKSP} signify the same key. Following is a list of the names for all the unprintable characters. In this list, synonyms are listed next to each other: (The following is a representation of the various functions of the control key)

Select a node in tree like structure in RFT

treeName=getPathForFirstNodeWithRegex("text object which I want to click",tree__LoanDashboard());
System.out.println(treeName);

tree__LoanDashboard().doubleClick(atPath(treeName));

Method for above mentioned code

public static String getPathForFirstNodeWithRegex(String sPattern, GuiSubitemTestObject targetTree) throws Exception
{
//create the regex object that will do the matching for us
Regex rPattern = new Regex(sPattern);

//loop through each navigation string, starting from the top of the
//tree, and working to the bottom of the tree
for(int i = 0; i < myPaths.length; i++)
{
//if the regex matches the current node…
if(rPattern.matches(myPaths[i]))
{
//return the navigation string for that node
return myPaths[i];
}
}

/**
* Returns a string array where each element is a navigation string.
* The array is ordered in the same way that the tree is ordered
* @param targetTree –the tree to get the details from
* @return –String[]
* @throws Exception
*/
private static String[] arrayOfNavigationPaths(GuiSubitemTestObject targetTree) throws Exception
{
//set up array to hold details
//String sNavigationPaths[];

//get the nodes from the tree
ITestDataTreeNode[] nodes = ((ITestDataTree)targetTree.getTestData("tree")).getTreeNodes().getRootNodes();

//return a string array, based on splitting the results
//string on the newline character
return HelperSuperClass.getPathForAllNodes("", nodes, true).split("\n");
}

/**
* Iterates through all nodes and figures out the tree navigation path for
* each node.
* @param sPrefix –the current location in the tree
* @param nNodes –the nodes to iterate through (generally, this is just the
* root node of the tree, although beginning halfway up the tree is possible)
* @param isRootNode –pass in "true" if the nNodes being passed in is the
* root node.
* @return — A string containing the navigation path for each node, separated
* by return characters
*/
private static String getPathForAllNodes(String sPrefix, ITestDataTreeNode[] nNodes, boolean isRootNode)
{
//if there are no nodes, return
if(nNodes == null)
{
return "";
}

//prepare a blank string to contain the result of interogating the node
String sResult= "";

//get the child nodes of the current node
ITestDataTreeNode[] nChildren = nNodes[index].getChildren();

/*
* if the current node has children, recursively call this method,
* passing in the current tree nav path, the child nodes, and "false"
* so that we know that we’re not at the tree root any more
*/
if(nChildren != null)
{
sResult = sResult + getPathForAllNodes(sNextLine, nChildren, false);
}
}

// Find all the windows on the system IWindow windows[] = root.getTopWindows(); String className;

for (int i=0;i<windows.length;i++) { // Get the class name of each window className = windows[i].getWindowClassName(); System.out.println(className); // If the window is an instance of IE, close it if (className.equals("IEFrame")) { System.out.println("***************"+className); windows[i].close(); } }}