Subscribe by Email


Friday, September 7, 2012

How will you handle Java tree in QTP?


In this article we shall talk about how to handle java trees in quick test professional. But first let us see what a java tree actually is.

What is a Java Tree?

- Java tree is a data structure unique to java which can be used to display hierarchical data. 
- Java tree does not essentially holds or stores data rather it just provides the user with a view of the data i.e., in the way the data has been actually organized in the software system or application.
- The java tree obtains all this data by generating queries to the data model just like any other non- trivial swing component. 
- The data in a java tree is represented in a vertical manner. 
- Each row in this vertical representation displays only one data item called a node. 
- Each java tree has got it roots in the root node and this is from where all the branches of the tree descend. 
- In the default mode, the root node of a java tree is automatically displayed but this view can be modified. 
- The branch nodes are also referred to as children.
- The branch nodes can be expanded and collapsed as required. 
- Identification of a specific node in the tree can be done via a tree path. 
- A tree can be thought of as a container class that consists of elements of the type node. 
- These node elements can be thought of as thin cover over the actual data which has to be assigned some generic type. 
- These nodes cover the actual data which has to be represented by the means of a hierarchical data structure i.e., nothing but the java tree. 
- The java trees don’t become useful on their own. 
- They become useful when one can store and retrieve some tasks via them from the data base of the application.  
- Java trees are the one kind of the data structures which can represent the data in its true hierarchical manner. 
- It is possible for a node not to have any children whereas in other cases a node may have a large number of children and such nodes are referred to as branch nodes.

How to handle Java tree in QTP?

Java trees have a place in quick test professional also and now we going to discuss how to handle one. 
- For handling a java tree in quick test professional it is required that a java add–in is installed in the quick test professional. 
- In the tools menu there is one drop down list available by the name of “object identification”. 
- In this drop down list you will get one option “java” which facilitates the recognition of the objects. 
- Now from this drop down list select the tree option. 
- All you have to do is to add the properties that you want to be identified. 
- Just after doing this the quick test professional will be able to recognize the java tree. 
- If not this way you can even use DOM for the same purpose. 
Here what you need to do is to make an appropriate code selection from the back ground and have it modified accordingly. 
- Another way can be to first select the option “JavaAdd” and then launch the quick test professional. 
- Your next step will be to record all the operations that are being performed up on the java tree. 
- If you face any problem with this way then you can try going back to the java tree object properties and modify the assistive and mandatory properties for easy identification. 
- You may face some difficulty while trying to expand all the nodes of the java tree even by using expandpath and expandrow commands.  


No comments:

Facebook activity